Rake task runs both Test::Unit and RSpec tests

Posted by Vincent Woo Sat, 19 Jan 2008 03:04:00 GMT

I’m in the middle of converting tests from Test::Unit to RSpec in an older Rails project. So far so good although I’m sure that would change as I dive into more complicated test cases. Still, I’m hoping the pain is worth it for the multiple contexts and lessened fixture reliance.

A nifty feature that I accidentally stumbled upon is that the default rake task would run the test in both test and spec directories. It’s not like I have to exclusively choose one or the other.

That opens up lots of test conversion options. I could convert the tests all at once or a little at a time. Or I could forget about conversion completely and merely write new tests in RSpec.

It’s little surprises like this that brightens up my workday.

UPDATE (FEB8,08): RSpec tests won’t run unless all Test::Unit tests passes.

Posted in  | Tags , , , ,  | no comments | no trackbacks