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

Commit

Permalink
Closes issue #20
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos authored and Gabe Berke-Williams committed Sep 9, 2011
1 parent 62e9202 commit ba8a264
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/kumade/deployer.rb
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions spec/kumade/deployer_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit ba8a264

Please sign in to comment.