method

it_should_behave_like

it_should_behave_like(*shared_example_groups)
public

Use this to pull in examples from shared example groups.

2Notes

Shared examples

mutru · Jun 1, 20091 thank

Use it together with share_examples_for like this:

share_examples_for "a shape" do
it "should have a color" do
  # ...
end

it "should have a center point" do
  # ...
end
end

describe "a circle" do
it_should_behave_like "a shape"

it "should be round" do
  # ...
end
end

Reusing shared examples

emime · Jun 12, 2009

==== share_examples_for "a shape" do it "should have a color" do @shape.color.should == :black end end

describe "a circle" do before(:all) do @shape = Circle.new end it_should_behave_like "a shape" end