Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Print error if something goes wrong in deploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 14, 2011
1 parent 6359702 commit c27f13f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/kumade/deployer.rb
Expand Up @@ -18,7 +18,8 @@ def deploy
pre_deploy
heroku.sync
heroku.migrate_database
rescue
rescue => deploying_error
Kumade.outputter.error("#{deploying_error.class}: #{deploying_error.message}")
ensure
post_deploy
end
Expand Down
14 changes: 10 additions & 4 deletions spec/kumade/deployer_spec.rb
Expand Up @@ -28,12 +28,18 @@
subject.deploy
end

it "calls post_deploy if deploy fails" do
subject.git.stubs(:heroku_remote?).raises(RuntimeError)
context "if deploy fails" do
before { subject.git.stubs(:heroku_remote?).raises(RuntimeError.new("fun times")) }

subject.expects(:post_deploy)
it "calls post_deploy" do
subject.expects(:post_deploy)
subject.deploy
end

subject.deploy
it "prints the error" do
subject.deploy
Kumade.outputter.should have_received(:error).with("RuntimeError: fun times")
end
end
end

Expand Down

0 comments on commit c27f13f

Please sign in to comment.