Module: RSpec::Core::SharedExampleGroup::TopLevelDSL

Defined in:
lib/rspec/core/shared_example_group.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) share_as(name)

59
60
61
62
63
# File 'lib/rspec/core/shared_example_group.rb', line 59
def share_as(name, &block)
  RSpec.deprecate("Rspec::Core::SharedExampleGroup#share_as",
                  :replacement => "RSpec::SharedContext or shared_examples")
  SharedExampleGroup.registry.add_const('main', name, &block)
end

- (Object) shared_example_groups

65
66
67
# File 'lib/rspec/core/shared_example_group.rb', line 65
def shared_example_groups
  SharedExampleGroup.registry.shared_example_groups_for('main')
end

- (Object) shared_examples(*args) Also known as: shared_context, share_examples_for, shared_examples_for

51
52
53
# File 'lib/rspec/core/shared_example_group.rb', line 51
def shared_examples(*args, &block)
  SharedExampleGroup.registry.add_group('main', *args, &block)
end