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

2008-11-01 Thread Nick Hoffman
On 2008-10-31, at 20:17, Pat Maddox wrote: Nick Hoffman <[EMAIL PROTECTED]> writes: I can make this 22-line action a bit shorter? =) http://refactormycode.com/codes/575-dry-up-a-controller-action I should have known I'd get called out on this :) I pushed around some stuff that I think should

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

2008-10-31 Thread Pat Maddox
Nick Hoffman <[EMAIL PROTECTED]> writes: > On 2008-10-30, at 15:31, Pat Maddox wrote: >> eh I dunno. I mean, I completely agree that hard-to-write tests often >> expose bad code. But there isn't any gray area when it comes to >> designing Rails controllers, in my opinion. I see an action that's

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

2008-10-31 Thread Nick Hoffman
On 2008-10-30, at 15:31, Pat Maddox wrote: eh I dunno. I mean, I completely agree that hard-to-write tests often expose bad code. But there isn't any gray area when it comes to designing Rails controllers, in my opinion. I see an action that's more than five lines long and I know it's wrong

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

2008-10-30 Thread Ashley Moran
On 30 Oct 2008, at 13:46, David Chelimsky wrote: I'd agree with this (in spite of my previous comments), and add to it. One of the benefits of writing examples is that they actually help to expose things that are growing complex. If it's hard to test, it's probably hard to change. Aslak made

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

2008-10-30 Thread Pat Maddox
"David Chelimsky" <[EMAIL PROTECTED]> writes: > On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> On 27 Oct 2008, at 16:35, Pat Maddox wrote: >> >>> Matt Wynne <[EMAIL PROTECTED]> writes: >>> Pat - are you going solo too? >>> >>> Nope, I'm trying to teach RSpec/BDD to

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

2008-10-30 Thread Zach Dennis
On Thu, Oct 30, 2008 at 9:46 AM, David Chelimsky <[EMAIL PROTECTED]>wrote: > On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > > On 27 Oct 2008, at 16:35, Pat Maddox wrote: > > > >> Matt Wynne <[EMAIL PROTECTED]> writes: > >> > >>> Pat - are you going solo too? > >> > >> Nop

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

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 9:47 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> Aslak made a good point earlier this thread with "don't write specs >> just cuz," but perhaps this fact is sufficient "cuz" to motivate. >> >> WDYT? > > There's something else here (nothing to do with testing rails controller

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

2008-10-30 Thread Matt Wynne
Aslak made a good point earlier this thread with "don't write specs just cuz," but perhaps this fact is sufficient "cuz" to motivate. WDYT? There's something else here (nothing to do with testing rails controllers, but testing in general) about the psychological blockage to working up the t

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

2008-10-30 Thread David Chelimsky
On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 27 Oct 2008, at 16:35, Pat Maddox wrote: > >> Matt Wynne <[EMAIL PROTECTED]> writes: >> >>> Pat - are you going solo too? >> >> Nope, I'm trying to teach RSpec/BDD to an organization that currently >> doesn't use it and has

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

2008-10-30 Thread Matt Wynne
On 27 Oct 2008, at 16:35, Pat Maddox wrote: Matt Wynne <[EMAIL PROTECTED]> writes: Pat - are you going solo too? Nope, I'm trying to teach RSpec/BDD to an organization that currently doesn't use it and has 0% test coverage. It's interesting, to say the least. They're good devs, but even so

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

2008-10-30 Thread Pat Maddox
Matt Wynne <[EMAIL PROTECTED]> writes: > Pat - are you going solo too? Nope, I'm trying to teach RSpec/BDD to an organization that currently doesn't use it and has 0% test coverage. It's interesting, to say the least. They're good devs, but even so, the effects of not writing tests first (or ev

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

2008-10-29 Thread Zach Dennis
On Wed, Oct 29, 2008 at 6:02 PM, aslak hellesoy <[EMAIL PROTECTED]>wrote: > On Wed, Oct 29, 2008 at 10:32 PM, David Chelimsky <[EMAIL PROTECTED]> > wrote: > > On Tue, Oct 28, 2008 at 2:32 AM, Ashley Moran > > <[EMAIL PROTECTED]> wrote: > >> > >> On Oct 27, 2008, at 5:20 pm, Pat Maddox wrote: > >>

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

2008-10-29 Thread Zach Dennis
I forgot to add that until there is a new way to handle the role that controllers currently are responsible for, I would probably teach someone how to write good controllers and controller examples. I would also allow them to experience the pain that comes with trying to write bloated controller ac

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

2008-10-29 Thread Pat Maddox
"David Chelimsky" <[EMAIL PROTECTED]> writes: >> What's the consensus here then, controller specs yay or nay? >> >> 1 nay from Pat > > 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 w

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

2008-10-29 Thread Stephen Eley
On Wed, Oct 29, 2008 at 5:32 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > 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. Or use them, but don't knock yourself out trying to keep them perfe

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

2008-10-29 Thread aslak hellesoy
On Wed, Oct 29, 2008 at 10:32 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Oct 28, 2008 at 2:32 AM, Ashley Moran > <[EMAIL PROTECTED]> 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 fro

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

2008-10-29 Thread Zach Dennis
Controllers are such a funny thing. Right now they are necessary evil. Once you start feeling pain with controllers you start changing your thinking. Somehow everyone who starts learning Rails ends up with bloated controllers even if they've read all of the posts and articles on "skinny controllers

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

2008-10-29 Thread David Chelimsky
On Tue, Oct 28, 2008 at 2:32 AM, Ashley Moran <[EMAIL PROTECTED]> 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

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

2008-10-29 Thread Ashley Moran
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 t

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

2008-10-27 Thread Pat Maddox
On Mon, Oct 27, 2008 at 9:35 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > Matt Wynne <[EMAIL PROTECTED]> writes: > >> Pat - are you going solo too? > > Nope, I'm trying to teach RSpec/BDD to an organization that currently > doesn't use it and has 0% test coverage. It's interesting, to say the > lea

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

2008-10-27 Thread Ashley Moran
On Oct 27, 2008, at 12:26 am, David Chelimsky wrote: Due to Merb still being a bit of an unknown, that's making me lean towards neurotic perfectionism in my own code, at the moment. And I know just as soon as I've made them all perfect, David will redefine perfection again Are you callin

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

2008-10-26 Thread David Chelimsky
Sent from my iPhone On Oct 26, 2008, at 5:09 PM, Ashley Moran <[EMAIL PROTECTED]> wrote: On Oct 26, 2008, at 9:09 pm, Matt Wynne wrote: I don't know. I've got inheritance in my controllers, for example I have a MediaController which is subclassed by ImagesController and VideosControl

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

2008-10-26 Thread Ashley Moran
On Oct 26, 2008, at 9:09 pm, Matt Wynne wrote: I don't know. I've got inheritance in my controllers, for example I have a MediaController which is subclassed by ImagesController and VideosController. The specs allowed me to factor out this base class. I think controllers are OK for doing B

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

2008-10-26 Thread Matt Wynne
On 26 Oct 2008, at 10:39, Ashley Moran wrote: On Oct 26, 2008, at 12:03 am, Ben Mabey wrote: I agree with most of this. For a purely RESTful controller I like to use a plugin, like make_resourceful, that will take care of all the boilerplate code that becomes very tedious to spec out and

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

2008-10-26 Thread Ashley Moran
On Oct 26, 2008, at 12:03 am, Ben Mabey wrote: I agree with most of this. For a purely RESTful controller I like to use a plugin, like make_resourceful, that will take care of all the boilerplate code that becomes very tedious to spec out and write. Since the plugins are tested I can jus

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

2008-10-25 Thread Ben Mabey
Pat Maddox wrote: If I say we're going to skip controller specs because they don't add enough value, how do I know that won't be interpreted as "controller specs are too hard, don't write specs when it's hard"? I have a three-headed defense of rarely writing controller specs anymore: * Co

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

2008-10-25 Thread Stephen Eley
On Sat, Oct 25, 2008 at 10:12 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > > [ . . . ] I think what you're talking about is a pretty > 'ri' technique[1] though - I strongly believe you need to have experienced > full-blown disciplined 100% TDD before you could honestly and responsibly > know when t

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

2008-10-25 Thread Pat Maddox
> If I say we're going to > skip controller specs because they don't add enough value, how do I > know that won't be interpreted as "controller specs are too hard, > don't write specs when it's hard"? I have a three-headed defense of rarely writing controller specs anymore: * Controllers are alre

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

2008-10-25 Thread Ashley Moran
On Oct 25, 2008, at 6:19 pm, David Chelimsky wrote: I actually know what you mean, and found myself this week driving out what I'd initially intended as a spike from a cucumber scenario, using rspec examples to shape it later. I think what you're talking about is a pretty 'ri' technique[1]

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

2008-10-25 Thread David Chelimsky
On Sat, Oct 25, 2008 at 9:12 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 25 Oct 2008, at 14:33, David Chelimsky wrote: > >> On Sat, Oct 25, 2008 at 5:12 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >>> >>> examples that fail because you haven't written the code yet. This is >>> crucial: resist the

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

2008-10-25 Thread Matt Wynne
On 25 Oct 2008, at 14:33, David Chelimsky wrote: On Sat, Oct 25, 2008 at 5:12 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: examples that fail because you haven't written the code yet. This is crucial: resist the urge to touch the code until you have a failing spec. At the risk of creating con

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

2008-10-25 Thread David Chelimsky
On Sat, Oct 25, 2008 at 5:12 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > There are screencasts on peepcode and also Pat Maddox has done one, but I > think they may be a bit out of date, and more focussed on just the mechanics > of getting up and running with the old story runner rather than the wor

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

2008-10-25 Thread Matt Wynne
There are screencasts on peepcode and also Pat Maddox has done one, but I think they may be a bit out of date, and more focussed on just the mechanics of getting up and running with the old story runner rather than the workflow once you get going. Ben Mabey's blog[1] has some useful experie

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

2008-10-25 Thread Tom Stuart
Hi, Going to dive into Cucumber soon, and just reading through all the docs now. Can anyone point to an example of writing Cucumber features first and then "when you get down to nitty gritty details, drop down one abstraction level and use RSpec to write some specs for your classes" (as