Method: RSpec::Core::Configuration#include
- Defined in:
- lib/rspec/core/configuration.rb
#include(mod, *filters) ⇒ void
Note:
Filtered module inclusions can also be applied to individual examples that have matching metadata. Just like Ruby's object model is that every object has a singleton class which has only a single instance, RSpec's model is that every example has a singleton example group containing just the one example.
Tells RSpec to include mod
in example groups. Methods defined in
mod
are exposed to examples (not example groups). Use filters
to
constrain the groups or examples in which to include the module.
1435 1436 1437 1438 1439 |
# File 'lib/rspec/core/configuration.rb', line 1435 def include(mod, *filters) define_mixed_in_module(mod, filters, @include_modules, :include) do |group| safe_include(mod, group) end end |