Alan H.
Alan H.

Reputation: 16578

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?

Upvotes: 13

Views: 3943

Answers (1)

rorra
rorra

Reputation: 9693

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

Upvotes: 17

Related Questions