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 def describe(name, *args, &block) _nested_group_declarations << [name, block, *args] end
# File lib/rspec/core/shared_context.rb, line 23 def included(group) [:before, :after].each do |type| [:all, :each].each do |scope| group.hooks[type][scope].concat hooks[type][scope] end end _nested_group_declarations.each do |name, block, *args| group.describe name, *args, &block end end
Generated with the Darkfish Rdoc Generator 2.