Rails/Rspec without using -T have any downside?

42 views Asked by At

I've been learning Rails and it seems that many prefer RSpec over Test Unit, but I've been reading that some like using both. If you created a Rails project without "-T" on "rails new..." so that you can keep yourself open to the possibility of using both later will there be any downside?

1

There are 1 answers

0
geoffharcourt On

The main benefits of using the -T option when you set up your project is that the spec_helper.rb file will be set up automatically and your generators (if you use them) will create RSpec tests by default. There's really no disadvantage to setting things up later as long as you know how to set up RSpec.

As far as leaving open the possibility of switching, I think the effort involved in either maintaining two unit test frameworks and/or rewriting your tests to fit a different framework later isn't worth it. I'm an RSpec guy, but when I take over a project that uses TestUnit or Minitest, I just power on through and keep working with what's already there. As soon as you get to a point where you have to have to run two sets of unit tests (not to mention acceptance/functional/integration tests if you're using something like Cucumber), you're increasing the time and effort required to run your tests, which makes it less likely they will get run as often as they should be.