Running the Rspec spec task as the default task in Rails 1

Posted by Kurt Schrader Tue, 04 Mar 2008 23:54:00 GMT

Whenever I start a new Rails project, one of the first things I do is install Rspec and delete the Rails default test directory. Even with that directory missing, however, Rails continues to waste my time by trying to run its various testing tasks.

To make it stop, just add the following:

Rake::Task[:default].prerequisites.clear
task :default => :spec

to the bottom of the Rakefile in the root application directory.

Obviously, if you want to have a default task other than spec, just change the right side of the second line to whatever task you want it to run.

Comments

Leave a comment

  1. Avatar
    JJ about 16 hours later:

    Simple solution, but very accurate! Thanks for this!

Comments