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

Commit

Permalink
fixing restart on cedar
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Feb 28, 2012
1 parent 7e0e11e commit 07e30d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/kumade/heroku.rb
Expand Up @@ -32,7 +32,7 @@ def delete_deploy_branch
end

def heroku(command)
full_heroku_command = "#{bundle_exec_heroku} #{command} --remote #{Kumade.configuration.environment}"
full_heroku_command = "#{bundle_exec_heroku(command)} --remote #{Kumade.configuration.environment}"
command_line = CommandLine.new(full_heroku_command)
command_line.run_or_error("Failed to run #{command} on Heroku")
end
Expand All @@ -49,11 +49,11 @@ def cedar?

private

def bundle_exec_heroku
if cedar?
"bundle exec heroku run"
def bundle_exec_heroku(command)
if cedar? and command != 'restart'
"bundle exec heroku run #{command}"
else
"bundle exec heroku"
"bundle exec heroku #{command}"
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions spec/kumade/heroku_spec.rb
Expand Up @@ -105,6 +105,13 @@
Kumade::CommandLine.should have_received(:new).with(regexp_matches(/bundle exec heroku run rake/)).once
command_instance.should have_received(:run_or_error).once
end

it "runs restart command without `run`" do
subject.heroku("restart")

Kumade::CommandLine.should have_received(:new).with(regexp_matches(/bundle exec heroku restart/)).once
command_instance.should have_received(:run_or_error).once
end
end

context "when not on Cedar" do
Expand Down

0 comments on commit 07e30d4

Please sign in to comment.