On 14 Jul 2010, at 18:35, Yiannis wrote:

Any good book or resource to start learning TDD with rails?

http://www.google.com/search?q=test+driven+development+with+rails

But even with all these resources, it's good to keep in mind there's several options for testing your Rails app.

We use RSpec for unit testing, Cucumber + Webrat + Selenium for integration tests, Factory Girl for factories (instead of fixtures). It all comes down to what you prefer and all I can say is that I really don't prefer the default Rails testing framework.

Also, if you're not fairly familiar with Rails in the first place, TDD or BDD may be a bit too much to start off with, especially if test- first development is completely new for you. I wouldn't recommend it to be honest, you'll probably give up before having something showing up in your browser.

That said, except on rare occasions where we implement a feature that we haven't really fleshed out completely, we develop using BDD. Not only does it avoid deep nested bugs, but it also keeps you on track, it's very tempting to add new "little" features along the way if you haven't set a clear path to start off with. By testing first, you work towards the goal you set and once you achieve that goal, you move on to adding those nice little extras if there is still a need for them and you can do so without worrying about breaking what you already have.


Best regards

Peter De Berdt

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to