Peter De Berdt wrote: > 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.
Agreed. (Though I think I prefer Machinist to Factory Girl, and I use little enough JavaScript that Selenium is not usually necessary for me.) > > 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. I don't think I agree with this at all. I learned Ruby, Rails, and test-first development at the same time -- then again, I'd already had 8 years of Web development experience by that point, and I'm a fast learner. http://www.sitepoint.com/forums/showthread.php?t=381413 was pretty helpful in taking those first steps, though it's perhaps a bit different from how I'd do it today (and it's in PHP). A lot of stuff at http://c2.com/cgi/wiki (Ward's Wiki) might be useful, and there's a good example at http://www.xpsd.org/cgi-bin/wiki?TestDrivenDevelopmentTutorialRomanNumerals . There's also an excellent Cucumber presentation at http://www.slideshare.net/josephwilk/outsidein-development-with-cucumber-and-rspec . > > That said, except on rare occasions where we implement a feature that > we haven't really fleshed out completely, we develop using BDD. I don't understand this statement. I would think that implementing a feature that's not completely fleshed out would be *exactly where you'd most want BDD*. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

