Search code examples
ruby-on-railsruby-on-rails-3rake

Disable rake task


In our project, if you run rake test, terrible things happen; you need to run rake spec. I can't seem to figure out how to re-define rake test to just output a message suggesting running rake spec instead.

How can I do this?


Solution

  • On your Rakefile at the end:

    Rake::Task["test"].clear
    task 'test' do
        puts "use 'rake spec'"
    end
    

    Or even better

    Rake::Task["test"].clear
    task 'test' do
        Rake::Task["spec"].invoke
    end