[rspec-users] it "should [action] ..." vs it with an active voice
philodespotos at gmail.com
Mon Nov 12 14:51:19 EST 2007
On Nov 12, 2007 11:39 AM, Brian Takita <brian.takita at gmail.com> wrote:
> 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
> * it describes what the software will do and what it does (both from
> the Test Driven Design and Regression verification lifecycles of the
> * 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 :)
I definitely agree that the active voice is nice in spec strings.
A coworker, when he first saw the use of 'should', said something
along the lines of "I thought you were writing specifications, not
recommendations." I fumbled and tried to explain that away, but the
objection has stuck with me. I've also noticed on Rubinius' spec style
guide that the use of should is discouraged:
There are still some places that I use 'should', and if I'm working in
a project that tends to use it, I'll stick with it. But in my own
work, I prefer 'it has 4 entries' to 'it should have 4 entries'.
(Though, in the code, the use of 'should' to express the expectation,
does make sense, as the Rubinius page explains).
Thanks for bringing this up, I'd been thinking about it lately.
More information about the rspec-users