Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing restart on cedar

  • Loading branch information...
commit 07e30d4152c87d48f740aa2893a8344fb7e24538 1 parent 7e0e11e
@carhartl carhartl authored
Showing with 12 additions and 5 deletions.
  1. +5 −5 lib/kumade/heroku.rb
  2. +7 −0 spec/kumade/heroku_spec.rb
View
10 lib/kumade/heroku.rb
@@ -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
@@ -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
View
7 spec/kumade/heroku_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.