Module: RSpec::Core::SharedExampleGroup
- Included in:
- ExampleGroup
- Defined in:
- lib/rspec/core/shared_example_group.rb
Instance Method Summary collapse
- #share_as(name, &block) ⇒ Object deprecated Deprecated.
-
#shared_examples(*args, &block) ⇒ Object
(also: #shared_context, #share_examples_for, #shared_examples_for)
Wraps the
block
in a module which can then be included in example groups usinginclude_examples
,include_context
, orit_behaves_like
.
Instance Method Details
#share_as(name, &block) ⇒ Object
Deprecated.
40 41 42 43 44 |
# File 'lib/rspec/core/shared_example_group.rb', line 40 def share_as(name, &block) RSpec.deprecate("Rspec::Core::SharedExampleGroup#share_as", "RSpec::SharedContext or shared_examples") Registry.add_const(name, &block) end |
#shared_examples(name, &block) ⇒ Object #shared_examples(name, tags, &block) ⇒ Object Also known as: , ,
Wraps the block
in a module which can then be included in example
groups using include_examples
, include_context
, or
it_behaves_like
.
31 32 33 |
# File 'lib/rspec/core/shared_example_group.rb', line 31 def shared_examples *args, &block Registry.add_group(*args, &block) end |