From: David Chelimsky Date: 2007-01-22T12:09:10+09:00 Subject: Re: I don't get rspec On 1/19/07, nicknameoptional wrote: > > 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. You may not now, but if you have to maintain your app over a long period of time, with changing requirements, you will likely have to some restructuring of some kind. This is an interesting thing about Rails in general right now. It's still in its infancy and there aren't too many companies besides 37 signals that have had to maintain Rails apps over several years. I think as that happens that we'll see more and more interest in refactoring strategies and tools. > > 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? It clarifies which comes first, the expected value or the actual value: assert_equal(5, result) ??? assert_equal(result, 5) ??? result.should == 5 That's pretty easy to get right. > > >