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



67
68
69
70
# File 'lib/rspec/core/shared_example_group.rb', line 67

def share_as(name, &block)
  RSpec.deprecate("`share_as`", :replacement => "`RSpec::SharedContext` or `shared_examples`")
  SharedExampleGroup.registry.add_const('main', name, &block)
end

#share_examples_for(*args, &block) ⇒ Object



62
63
64
65
# File 'lib/rspec/core/shared_example_group.rb', line 62

def share_examples_for(*args, &block)
  RSpec.deprecate("`share_examples_for`", :replacement => "`shared_examples` or `shared_examples_for`")
  shared_examples(*args, &block)
end

#shared_example_groupsObject



72
73
74
# File 'lib/rspec/core/shared_example_group.rb', line 72

def shared_example_groups
  SharedExampleGroup.registry.shared_example_groups_for('main')
end

#shared_examples(*args, &block) ⇒ Object Also known as: shared_context, shared_examples_for



55
56
57
# File 'lib/rspec/core/shared_example_group.rb', line 55

def shared_examples(*args, &block)
  SharedExampleGroup.registry.add_group('main', *args, &block)
end