[rspec-devel] [ rspec-Feature Requests-6396 ] Disabled Specifications and a Yellow build

noreply at rubyforge.org noreply at rubyforge.org
Mon Oct 30 20:46:08 EST 2006


Feature Requests item #6396, was opened at 2006-10-30 02:51
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6396&group_id=797

Category: runner module
Group: None
Status: Open
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Disabled Specifications and a Yellow build

Initial Comment:
Add a method that denotes a specification is disabled and causes a yellow build.

For example:
disable_specify "should support disabled specifications" do
end

This will be helpful in writing a spec before the feature is implemented.

----------------------------------------------------------------------

>Comment By: Aslak Hellesoy (aslak_hellesoy)
Date: 2006-10-30 20:46

Message:
which leaves us to:

# todo specify "something that needs doing"

and then use my editor to find the todos. all good text editors have that built-in. why should we reimplement this in rspec?

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-30 20:30

Message:
todo - I like that also.

----------------------------------------------------------------------

Comment By: Aslak Hellesoy (aslak_hellesoy)
Date: 2006-10-30 19:18

Message:
how about

todo "something that needs doing"

instead of

implement "something that needs doing"

because implement is really just a todo - isn't it?

----------------------------------------------------------------------

Comment By: Jay Levitt (jaylev)
Date: 2006-10-30 08:33

Message:
+1 for implement

----------------------------------------------------------------------

Comment By: Mike Vincent (agile)
Date: 2006-10-30 08:07

Message:
The suggested "implement" placeholder would be pretty cool. I have generally started fleshing out specs on rails based projects by flurrying through the model specs spewing out minimal specify statements for the limited things I know about them. Usually just throwing in violations as I'm flying through. Then I start running the specs and going through adding the contraints and going for green. 

It's a pretty noisy "todo" list when running the specs to find the placeholders. It'd be nice to have a more aesthetically pleasing "todo list" to work from. :) But I concur that being able to turn a real spec yellow probably isn't the behavior we're looking for. rake spec:implement or something that produced a spec:doc like format or something would be pretty nice. 

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-30 07:12

Message:
FWIW - Irony of ironies, there is currently an abhorrently commented out spec in the trunk. And *I'm* the one who put it there. Even still, I'd rather do so and feel a little dirty about it than have the tool make me feel clean. Or even just a little yellow.

Cheers,
David

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-30 04:57

Message:
Writing an entire specify block before a feature is implemented is not what BDD is about. It goes against the red/green/refactor cycle of TDD, which sits at the heart of BDD.

For what it's worth, there is a similar feature in NUnit. I don't believe that I've ever seen it used to allow tests to be ignored in advance of implementation. I've only ever seen it used to ignore existing tests that had been passing and were now failing. Worse, I've seen this cause yellow to become the new green (i.e. an acceptable state for commits and sometimes even releases). Absolutely vile.

That said, making decisions about behaviour in advance of implementation is very much aligned w/ BDD, even TDD. What would you think about something like this:

implement "should support placeholders for yet to exist specs"

This would not accept a block. In fact it would raise if you try to give it one. This way you could write placeholders for specs you know you want, but not allow you to put any code in them. Then there could be a command line option that allows you to report on yet-to-implement specs.

Of course, if you insist on violating one of the most basic principles of BDD, you can write up your spec code and comment it out. The commented code would be in a logical place, but the tool would not be condoning the practice.

Thoughts?

David

----------------------------------------------------------------------

Comment By: Brian Takita (btakita)
Date: 2006-10-30 02:57

Message:
I submitted this.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6396&group_id=797


More information about the rspec-devel mailing list