Created
May 12, 2018 15:55
-
-
Save cupnoodle/8e7df9eb6e2ebdee82d321f45c90d83c to your computer and use it in GitHub Desktop.
Run rake task in rspec test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake' | |
# make sure to set correct relative path | |
load File.expand_path("../../../../lib/tasks/once.rake", __FILE__) | |
describe 'some name' do | |
before(:all) do | |
# because rake task accepts different environment | |
Rake::Task.define_task(:environment) | |
#replace 'once:create_tags' with your own rake task | |
Rake::Task['once:create_tags'].invoke | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment