[rspec-users] rspec 2.7.0.rc1 is released!

David Chelimsky dchelimsky at gmail.com
Mon Oct 10 10:22:20 EDT 2011


On Oct 10, 2011, at 4:16 AM, Ash Moran wrote:

> 
> On 9 Oct 2011, at 21:23, David Chelimsky wrote:
> 
>> * Allow classes/modules to be used as shared example group identifiers
>>   (Arthur Gunn)
> 
> This sounds awesome. Are there any full examples? I could only see unit tests in the code.

Nope. Wanna add one?

The basic idea is:

shared_examples Enumerable do
  describe "#count" do
    it "returns 0 by default" do
      subject.count.should eq(0)
    end
  end
end

describe SpecialCollection do
  it_behaves_like Enumerable
end

Cheers,
David


More information about the rspec-users mailing list