Last active
September 19, 2016 23:40
-
-
Save malclocke/117786bf593c3ffde6f2 to your computer and use it in GitHub Desktop.
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
# Example integration spec for a Rake task in Rails | |
# | |
# cat <<EOT > lib/tasks/myapp.rake | |
# namespace :myapp do | |
# task :mytask => :environment do | |
# puts "Hello" | |
# end | |
# end | |
# EOT | |
require "rails_helper" | |
describe "Rake tasks" do | |
before(:all) do | |
Myapp::Application.load_tasks | |
end | |
describe "myapp:mytask" do | |
subject { Rake::Task["myapp:mytask"] } | |
specify do | |
# Run the rake task and store the output | |
output = capture(:stdout) do | |
subject.invoke | |
end | |
expect(output).to match /Hello/ | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment