Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我们的项目中,如果你运行rake test,就会发生可怕的事情;你需要运行rake spec。我似乎无法弄清楚如何重新定义rake test以仅输出一条建议运行的消息rake spec。
rake test
rake spec
我怎样才能做到这一点?
最后在你的 Rakefile 上:
Rake::Task["test"].clear task 'test' do puts "use 'rake spec'" end
甚至更好
Rake::Task["test"].clear task 'test' do Rake::Task["spec"].invoke end