I have a rake task test that I setup following the only examples I could find online.
It looks like this:
require \'test_helper\'
require \'minitest/
I've tried @iheggie answer but it worked in a way that indeed tests were run once but any other task was breaking with Don't know how to build task '
.
I'm on Rails 3.2 still. It turned out that there were couple tasks loaded beforehand so the Rake::Task.tasks.empty?
was never true
and all other useful tasks were not loaded. I've fiddled with it and this version of it works for me right now:
Rake::Task.clear if Rails.env.test?
MyAppName::Application.load_tasks
Hope this helps anyone.