[rspec-users] Working outside-in with Cucumber and RSpec

Zach Dennis zach.dennis at gmail.com
Thu Oct 30 00:21:31 EDT 2008


On Wed, Oct 29, 2008 at 6:02 PM, aslak hellesoy <aslak.hellesoy at gmail.com>wrote:

> On Wed, Oct 29, 2008 at 10:32 PM, David Chelimsky <dchelimsky at gmail.com>
> wrote:
> > On Tue, Oct 28, 2008 at 2:32 AM, Ashley Moran
> > <ashley.moran at patchspace.co.uk> wrote:
> >>
> >> On Oct 27, 2008, at 5:20 pm, Pat Maddox wrote:
> >>
> >>> When it comes to controllers specs, mocks provide the most value by
> >>> isolating from the model and db - the specs run faster, and you don't
> >>> have to worry about model validations.  But if you minimize controller
> >>> logic, you can write acceptance tests that give you confidence that
> >>> your controllers work, and then controller specs become unnecessary
> >>> overhead.
> >>
> >>
> >> What's the consensus here then, controller specs yay or nay?
> >>
> >> 1 nay from Pat
> >>
> >> 1 act of fence sitting from me...
> >
> > I think the nay from Pat was conditional, as it should be.
> >
> > I think the answer is: if you have to ask, then you should use them :)
> > Otherwise, don't use them when you feel confident that you don't need
> > them.
> >
>
> When working outside in, the granularity increases the further in you
> get. On the very outside it's cumbersome to test for edge cases.
>
> Start on the outside with Cucumber and whenever you come across an
> edge case, make a judgement on where the right abstraction level is to
> test it. That may be controller, view, model or somewhere else.
>
> Don't write specs just cuz
>


Very well put Aslak,


-- 
Zach Dennis
http://www.continuousthinking.com
http://www.mutuallyhuman.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081030/1dd22e09/attachment.html>


More information about the rspec-users mailing list