[rspec-users] BDD/Rails/Shoulda

Ashley Moran ashley.moran at patchspace.co.uk
Wed Apr 30 10:51:46 EDT 2008


On 28 Apr 2008, at 07:17, David Chelimsky wrote:

> Also, this approach increases the level of granularity from  
> individual messages to complete statements. For example, let's say I  
> have this line commented:
>
> # do_something if this_condition and that_condition
>
> If this_condition and that_condition always return the same boolean  
> value, there is no need for a test for that_condition to exist. Nor  
> should it exist without having been driven into existence by an  
> example.
>
> So the approach of uncommenting prototype code still leaves you with  
> code that is less clean, if only slightly, than code which is purely  
> driven out by examples.


Hmm, I have never found this in practice.  In fact, about a month ago  
I was working on someone else's code and followed this process of  
uncommenting code as I wrote the specs for it (there were none for  
that class).  I actually *removed* the 'if this_condition and  
that_condition' part of a line that follows the pattern you gave above.

I don't see how you could end up with redundant code following this  
process.  Perhaps I am doing something different that I didn't  
explain.  Maybe it's because I am blanking out what the code says when  
I write the specs?  I don't know, but I haven't found the problem you  
describe above.

Ashley


-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/





More information about the rspec-users mailing list