method
include

1.1.4 -
Show latest stable
-
0 notes -
Class: Spec::Example::Configuration
- 1.1.4 (0)
- 1.1.12
- 1.2.0
- 1.2.8
- 1.3.0
- 1.3.1
- What's this?
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