[rspec-users] it "should [action] ..." vs it with an active voice

Pat Maddox pergesu at gmail.com
Mon Nov 12 14:56:37 EST 2007

On Nov 12, 2007 9:39 AM, Brian Takita <brian.takita at gmail.com> wrote:
> I'd like to start gathering information/debating on the
> advantages/disadvantages of using it "should ..." vs other techniques.
> Dan North explained why we should use should:
> http://dannorth.net/introducing-bdd/
> I used to use it "should ..." for the projects I was on, until I was
> challenged by a fellow developer who started using it with an active
> voice.
> For example instead of:
> it "should go to the park"
> An active voice would be:
> it "goes to the park"
> After a few days of reluctance (or stubbornly hanging on to the rspec
> "convention"), I eventually adopted and grown to love using the active
> voice.
> Here are the main reasons that I prefer an active voice because:
> * using it "should ..." over and over renders should meaningless (I
> have grown this barely conscience aversion to the word 'should')
> * less less words are needed
> * the differentiating information of the 'it' statement is in the
> front, rather than hidden behind should (space to the left is at a
> premium)
> * it describes what the software will do and what it does (both from
> the Test Driven Design and Regression verification lifecycles of the
> test)
> * you still have a good "sentence template" that "should" provides
> (you have to make a coherent sentence)
> So here it my initial stab. Lets discuss :)
> Thanks,
> Brian
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

At first glance I think this will be an awkward style for me to adopt.
 It'll take a bit to break out of my current mentality.  That said, I
think it makes a lot of sense.  I'm going to try it out this week, and
hopefully I'll fall in love with it.


More information about the rspec-users mailing list