register(key, example_group_class) public

Registers an example group class klass with the symbol type. For example:

  Spec::Example::ExampleGroupFactory.register(:farm, FarmExampleGroup)

With that you can append a hash with :type => :farm to the describe method and it will load an instance of FarmExampleGroup.

  describe Pig, :type => :farm do

If you don’t use the hash explicitly, describe will implicitly use an instance of FarmExampleGroup for any file loaded from the ./spec/farm directory.

Show source
Register or log in to add new notes.