method

include

include(*args)
public

Declares modules to be included in multiple example groups (describe blocks). With no :type, the modules listed will be included in all example groups. Use :type to restrict the inclusion to a subset of example groups. The value assigned to :type should be a key that maps to a class that is either a subclass of Spec::Example::ExampleGroup or extends Spec::Example::ExampleGroupMethods and includes Spec::Example::ExampleMethods

  config.include(My::Pony, My::Horse, :type => :farm)

Only example groups that have that type will get the modules included:

  describe "Downtown", :type => :city do
    # Will *not* get My::Pony and My::Horse included
  end

  describe "Old Mac Donald", :type => :farm do
    # *Will* get My::Pony and My::Horse included
  end