module RSpec::Core::SharedExampleGroup
def shared_examples(name, *args, &block)
- See: ExampleGroup.include_context -
See: ExampleGroup.include_examples -
See: ExampleGroup.it_behaves_like -
Parameters:
-
block
() -- The block to be eval'd
-
metadata
(Array
) -- metadata to attach to this, Hash -
block
() -- The block to be eval'd
-
metadata
(Array
) -- metadata to attach to this, Hash -
name
(String, Symbol, Module
) -- identifer to use when looking up -
block
() -- The block to be eval'd
-
name
(String, Symbol, Module
) -- identifer to use when looking up
Overloads:
-
shared_examples(metadata, &block)
-
shared_examples(name, metadata, &block)
-
shared_examples(name, &block)
def shared_examples(name, *args, &block) top_level = self == ExampleGroup if top_level && RSpec.thread_local_metadata[:in_example_group] raise "Creating isolated shared examples from within a context is " \ "not allowed. Remove `RSpec.` prefix or move this to a " \ "top-level scope." end RSpec.world.shared_example_group_registry.add(self, name, *args, &block) end