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

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

Instance Method Summary collapse

Instance Method Details

#share_as(name, &block) ⇒ Object



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

#shared_example_groupsObject



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

#shared_examples(*args, &block) ⇒ Object 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