Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
testing rake in rspec (etc)
# ./spec/support/rake_testing_support.rb
def invoke_rake_task_in_test(task_name)
require 'rake'
Rails.application.load_tasks if Rake.application.tasks.count < 10
Rake::Task[task_name].reenable
Rake::Task[task_name].invoke
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.