Topic: Learning RoR, easiest way to test?

Hi,
I am just learning Rails. What is the best, fastest and easiest way to do testing? I find it a pain at the moment!
Heard of the default rails testing:units, cucumber, shoulda, and others.

Since I am a newbie, which will be be painless with a fast learning curve?
Thanks

Re: Learning RoR, easiest way to test?

Hey,

Testing can be a difficult thing to get your head around, especially if you are new to a language/framework. I don't thing any route to testing mastery comes without pain, and there are no shortcuts.

Rails comes by default with Test::Unit support, Test::Unit being the in-built testing framework shipping with Ruby. However a lot of people swap that out for RSpec. Pragmatic Programmers have a book in Beta: The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends and I would recommend it, even at this stage.

You will be hard-pressed to find such a wealth of good material gathered together in the same place, and if you go out on your own, you'll be piecing together blog articles dealing with different versions of Rails and versions of RSpec which will soon get very frustrating.

Re: Learning RoR, easiest way to test?

I went down the Cucumber, Rpsec, Webrat root for the very reason that it's well documented in the Beta version of the RSpec book. I'd initially chucked myself in the deep end by trying to set all this up with Rails 3 and I'm now glad I reverted to 2.3.5. The gem developers are busy chasing the Rails 3 tail to document anything properly.

It looks like there are other contenders like Capybara instead of Webrat but I figured I'd go with the better documented but potentially inferior setup.

I also purchased User Stories applied by Mike Cohn that seems to be an inspiration for many of the ideas behind RSpec and Cucumber and is frequently referenced in the RSpec book. It had some good Amazon reviews and I've since found it to be a good buy.

Pivotal Tracker has been a great help in turning the theory into practice as well.

Just my thoughts as a fellow Rails BDD noob.