nicknameoptional wrote the following on 20.01.2007 01:20 :
>> There is a  good Google video about rspec and Behavior Driven
>> Development by the very well-dressed Dave Astels:
>>
>> http://video.google.com/videoplay?docid=8135690990081075324&pl=true
>>
>> --
>> James Britt
>>
>>     
>
> I still fail to see the value added by rSpec. In the video, one main
> point I got was BDD try to break the 1-1 relation of class and test
> class, which he said is useful if refactoring code. but writing rails
> app, with convention over configuration ideology, I don't really do
> that much refactoring.
>
> and if you look at the example,
> "@stack.should_be_empty" is mapped to stack.empty? method,
> @stack.top.should_equal "one item" is stack.top == "one item"
>
> besides more English like, how is it better than the assert_equal?
>   

assert_equal is ambiguous and as said in the video, many mismatch the
parameters (I've done it several times myself).
@object.method.should_equal is less prone to errors.

This specific comment aside, from what I understood from the video the
main benefit is that it helps those who don't really get the test
process with TDD not being confused by the naming used in Test::Unit. It
keeps them in the right set of mind: "How should objects in some
contexts behave?" and not "what equality/difference/basic property/...
should I test?". This single change of context doesn't seem so helpful
at first glance, but in practice I've seen numerous developers
(including myself) being drowned in tests, adding new useless or
unimportant ones because they lost focus on what they should test:
correct behaviour of the application and its components. So I believe
this approach can help ("the language shapes the thought" as mentioned
in the video is probably true from my point of view).

A good point is that it definitely enhances test readibility too.

Lionel.