Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixing restart on cedar

  • Loading branch information...
commit 07e30d4152c87d48f740aa2893a8344fb7e24538 1 parent 7e0e11e
Klaus Hartl authored February 28, 2012
10  lib/kumade/heroku.rb
@@ -32,7 +32,7 @@ def delete_deploy_branch
32 32
     end
33 33
 
34 34
     def heroku(command)
35  
-      full_heroku_command = "#{bundle_exec_heroku} #{command} --remote #{Kumade.configuration.environment}"
  35
+      full_heroku_command = "#{bundle_exec_heroku(command)} --remote #{Kumade.configuration.environment}"
36 36
       command_line = CommandLine.new(full_heroku_command)
37 37
       command_line.run_or_error("Failed to run #{command} on Heroku")
38 38
     end
@@ -49,11 +49,11 @@ def cedar?
49 49
 
50 50
     private
51 51
 
52  
-    def bundle_exec_heroku
53  
-      if cedar?
54  
-        "bundle exec heroku run"
  52
+    def bundle_exec_heroku(command)
  53
+      if cedar? and command != 'restart'
  54
+        "bundle exec heroku run #{command}"
55 55
       else
56  
-        "bundle exec heroku"
  56
+        "bundle exec heroku #{command}"
57 57
       end
58 58
     end
59 59
   end
7  spec/kumade/heroku_spec.rb
@@ -105,6 +105,13 @@
105 105
       Kumade::CommandLine.should have_received(:new).with(regexp_matches(/bundle exec heroku run rake/)).once
106 106
       command_instance.should have_received(:run_or_error).once
107 107
     end
  108
+
  109
+    it "runs restart command without `run`" do
  110
+      subject.heroku("restart")
  111
+
  112
+      Kumade::CommandLine.should have_received(:new).with(regexp_matches(/bundle exec heroku restart/)).once
  113
+      command_instance.should have_received(:run_or_error).once
  114
+    end
108 115
   end
109 116
 
110 117
   context "when not on Cedar" do

0 notes on commit 07e30d4

Please sign in to comment.
Something went wrong with that request. Please try again.