Method: Spec::DSL::Main#share_examples_for

Defined in:
lib/gems/rspec-1.1.12/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


44
45
46
47
# File 'lib/gems/rspec-1.1.12/lib/spec/dsl/main.rb', line 44

def share_examples_for(*args, &block)
  Spec::Example::add_spec_path_to(args)
  Spec::Example::ExampleGroupFactory.create_shared_example_group(*args, &block)
end