[rspec-users] Shoulda

David Chelimsky dchelimsky at gmail.com
Tue Sep 30 10:05:33 EDT 2008


On Tue, Sep 30, 2008 at 7:59 AM, Zach Dennis <zach.dennis at gmail.com> wrote:
> Also, a nice thing about RSpec is that when you do describe an actual
> object, ie: "describe Foo", you can determine this by asking the
> example group what it's described type is.
>
> This makes things a lot simpler and cleaner than having to hack away
> strings, or guess based on the name of your test.
>
> Zach
>
> On Tue, Sep 30, 2008 at 8:57 AM, Zach Dennis <zach.dennis at gmail.com> wrote:
>> On Tue, Sep 30, 2008 at 8:41 AM, Andy Freeman <lists at ruby-forum.com> wrote:
>>> Are you willing to provide a simple example?
>>
>> I'm using the same example as the articled you linked to originally as
>> the base. This way you should be able to clearly see the differences.
>>
>> http://gist.github.com/13804

Here's a variation on that with a helper for defining macros that I'm
thinking of adding to rspec. Lemme know what you think:

http://gist.github.com/13821

Cheers,
David

>>
>> Zach
>>
>>>
>>> Andy
>>>
>>> Matt Wynne wrote:
>>>> We do something similar to this, though we use a convention to set
>>>> @klass to the class being spec'd in the top-level example group,
>>>> rather than deriving it as they do in that sample.
>>>>
>>>> In view specs we also use a convention to always have a do_render
>>>> method available, so that we can bring in similarly shared / generated
>>>> examples.
>>>>
>>>> It's great for speccing two sublcasses which have some common
>>>> behaviour, where it feels wrong to spec the (abstract) base class.
>>>
>>> --
>>> Posted via http://www.ruby-forum.com/.
>>> _______________________________________________
>>> rspec-users mailing list
>>> rspec-users at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/rspec-users
>>>
>>
>>
>>
>> --
>> Zach Dennis
>> http://www.continuousthinking.com
>> http://www.mutuallyhuman.com
>>
>
>
>
> --
> Zach Dennis
> http://www.continuousthinking.com
> http://www.mutuallyhuman.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list