Method: Spec::DSL::Main#share_examples_for

Defined in:
lib/spec/dsl/main.rb

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

Creates an example group that can be shared by other example groups

Examples

share_examples_for "All Editions" do
  it "all editions behaviour" ...
end

describe SmallEdition do
  it_should_behave_like "All Editions"

  it "should do small edition stuff" do
    ...
  end
end


47
48
49
50
51
# File 'lib/spec/dsl/main.rb', line 47

def share_examples_for(*args, &block)
  add_options(args)
  set_location(args.options, caller(0)[1])
  Spec::Example::ExampleGroupFactory.create_shared_example_group(*args, &block)
end