R – Is Test::Unit still relevant in rails


I am learning Rails the age old way. By reading Agile Web Development with Rails (3rd Edition) as a starting point. I am currently in the chapter that teaches Testing. I am also aware of other BDD Testing framework such as RSPec. So I was wondering if frameworks such as RSpec, Cucumber, Shoulda replace the need for knowing/using Test::Unit? Are they both relevant in their own right and used for different purposes?

UPDATE: Since I am new to Testing, I would also love to get feedback on what resources are useful to get my feet wet with different frameworks.


Best Solution

The world has changed! Check down and upvote @prusswan

I think Test::Unit is still relevant even though there is a lot of hype surrounding BDD and other testing tools.

That being said, if you are up for it, you could bypass learning Test::Unit and start with something like RSpec and Shoulda right away, but there is something to be said about following through the examples in the Agile Web Development Book to see where the ideas from BDD came from.

I find myself still using Test::Unit for some projects since it comes with Rails and is still a very great testing framework.

So long story short, I don't think it's obsolete but it's not the cutting edge any more. BDD is a testing paradigm shift especially if you start using Cucumber and Webrat, but it's fantastic once you get into it. Shoulda is the easiest to make the transition to, so I would start with Test::Unit, then move to Shoulda, then Give RSpec and Cucumber a try.

You are testing or at least interested in testing! That's the best part. In the end it doesn't matter what you use as long as you are happy with it.

Good luck!

Related Question