Permalink
Browse files

Closes issue #20

  • Loading branch information...
1 parent 62e9202 commit ba8a26400a9e0ebac99d599f8911039ffcfeade1 @tapajos tapajos committed with gabebw Sep 1, 2011
Showing with 20 additions and 5 deletions.
  1. +9 −5 lib/kumade/deployer.rb
  2. +11 −0 spec/kumade/deployer_spec.rb
@@ -14,11 +14,15 @@ def initialize(environment = 'staging', pretending = false)
end
def deploy
- ensure_heroku_remote_exists
- pre_deploy
- sync_heroku
- heroku_migrate
- post_deploy
+ begin
+ ensure_heroku_remote_exists
+ pre_deploy
+ sync_heroku
+ heroku_migrate
+ post_deploy
+ rescue
+ post_deploy
+ end
end
def pre_deploy
@@ -57,6 +57,17 @@
subject.deploy
end
+
+ it "should call post_deploy if deploy fails" do
+ subject.stub(:run => true)
+
+ subject.should_receive(:ensure_heroku_remote_exists).and_raise(RuntimeError)
+
+ subject.should_receive(:post_deploy)
+
+ subject.deploy
+ end
+
end
describe Kumade::Deployer, "#sync_github" do

0 comments on commit ba8a264

Please sign in to comment.