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.
1419 1420 1421 1422 1423 |
# File 'lib/rspec/core/configuration.rb', line 1419 def include(mod, *filters) define_mixed_in_module(mod, filters, @include_modules, :include) do |group| safe_include(mod, group) end end |