[rspec-users] it_should_behave_like

Scott Taylor mailing_lists at railsnewbie.com
Thu Jun 21 13:03:45 EDT 2007





On Jun 21, 2007, at 12:55 PM, David Chelimsky wrote:

> On 6/21/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
>>
>> What is the shared behavior between these two?  Do you want a valid,
>> saved, and accepted contract to act like an unaccepted contract?
>> Abstract out what is common between them, and then use that as the
>> shared description.
>>
>> See:  http://pastie.caboo.se/72413
>
> FYI - fixtures in shared behaviours don't ever get called. Just
> declare them in the behaviours that use them.
>

Ah.  Good to know.

Jordan:  One option is to add specification blocks in the shared  
behavior, and then define the instance variables per description, i.e.:

http://pastie.caboo.se/72418

Scott





More information about the rspec-users mailing list