Exposes [ExampleGroup](ExampleGroup)-level methods to a module, so you can include that module in an [ExampleGroup](ExampleGroup).
@example
module LoggedInAsAdmin extend RSpec::Core::SharedContext before(:each) do log_in_as :admin end end describe "admin section" do include LoggedInAsAdmin # ... end
# File lib/rspec/core/shared_context.rb, line 34 34: def describe(name, *args, &block) 35: _nested_group_declarations << [name, block, *args] 36: end
# File lib/rspec/core/shared_context.rb, line 23 23: def included(group) 24: [:before, :after].each do |type| 25: [:all, :each].each do |scope| 26: group.hooks[type][scope].concat hooks[type][scope] 27: end 28: end 29: _nested_group_declarations.each do |name, block, *args| 30: group.describe name, *args, &block 31: end 32: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.