Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 954
Alan H. Avatar asked Dec 05 '12 21:12

Alan H.


People also ask

What is a rake task?

Rake is a software task management and build automation tool created by Jim Weirich. It allows the user to specify tasks and describe dependencies as well as to group tasks in a namespace. It is similar in to SCons and Make.

What is environment rake task?

Including => :environment will tell Rake to load full the application environment, giving the relevant task access to things like classes, helpers, etc. Without the :environment , you won't have access to any of those extras.


1 Answers

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
like image 189
rorra Avatar answered Sep 22 '22 19:09

rorra