Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean up tests and vars after review

  • Loading branch information...
commit 0f26ba23104b1c738d6aa7c249f631132ec740c7 1 parent 0dd8fb1
@ryanbrainard ryanbrainard authored
Showing with 17 additions and 16 deletions.
  1. +6 −6 lib/heroku/command/deploy.rb
  2. +11 −10 spec/heroku/command/deploy_spec.rb
View
12 lib/heroku/command/deploy.rb
@@ -68,20 +68,20 @@ def war
end
status = json_decode(response)[RESPONSE_KEY_STATUS]
- monitorHash = nil
+ monitor_hash = nil
while status == STATUS_IN_PROGRESS
- monitorResponse = RestClient.get "https://#{host}#{polling_endpoint}", headers
- monitorHash = json_decode(monitorResponse)
- status = monitorHash[RESPONSE_KEY_STATUS]
+ monitor_response = RestClient.get "https://#{host}#{polling_endpoint}", headers
+ monitor_hash = json_decode(monitor_response)
+ status = monitor_hash[RESPONSE_KEY_STATUS]
if status != STATUS_SUCCESS && status != STATUS_FAILED
sleep 5
end
end
if status == STATUS_SUCCESS
- display(monitorHash[RESPONSE_KEY_MESSAGE] + " " + monitorHash[RESPONSE_KEY_RELEASE])
+ display(monitor_hash[RESPONSE_KEY_MESSAGE] + " " + monitor_hash[RESPONSE_KEY_RELEASE])
else
- raise(monitorHash[RESPONSE_KEY_MESSAGE])
+ raise(monitor_hash[RESPONSE_KEY_MESSAGE])
end
rescue Exception => e
raise Heroku::Command::CommandFailed, e.message
View
21 spec/heroku/command/deploy_spec.rb
@@ -5,14 +5,6 @@
before(:all) do
@app_name = ENV['HEROKU_TEST_APP_NAME']
@real_war = File.new("spec/resources/sample-war.war")
-
- @huge_war = create_fake_war(100)
- @too_huge_war = create_fake_war(101)
- end
-
- after(:all) do
- @huge_war.unlink
- @too_huge_war.unlink
end
context "when command options are are initialized" do
@@ -49,17 +41,26 @@
end
context "when a war file is huge" do
+ let(:huge_war) { create_fake_war(100) }
+
#noinspection RubyArgCount
- let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => @huge_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => huge_war.path }
+
+ after { huge_war.unlink }
it "the war should be deployed" do
deploy.war.should eql "success"
end
end
+ #todo
context "when a war file is too huge" do
+ let(:too_huge_war) { create_fake_war(101) }
+
#noinspection RubyArgCount
- let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => @too_huge_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => too_huge_war.path }
+
+ after { too_huge_war.unlink }
it "an error should be raised" do
lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "War file must not exceed 100 MB")
Please sign in to comment.
Something went wrong with that request. Please try again.