cfoundry 2.0.0 → 2.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cfoundry/v2/app.rb +3 -1
- data/lib/cfoundry/version.rb +1 -1
- data/spec/cfoundry/v2/app_spec.rb +12 -1
- metadata +5 -5
data/lib/cfoundry/v2/app.rb
CHANGED
@@ -168,7 +168,7 @@ module CFoundry::V2
|
|
168
168
|
# Determine application health.
|
169
169
|
#
|
170
170
|
# If all instances are running, returns "RUNNING". If only some are
|
171
|
-
# started, returns the
|
171
|
+
# started, returns the percentage of them that are healthy.
|
172
172
|
#
|
173
173
|
# Otherwise, returns application's status.
|
174
174
|
def health
|
@@ -189,6 +189,8 @@ module CFoundry::V2
|
|
189
189
|
else
|
190
190
|
state
|
191
191
|
end
|
192
|
+
rescue CFoundry::StagingError
|
193
|
+
"STAGING FAILED"
|
192
194
|
end
|
193
195
|
|
194
196
|
def running_instances
|
data/lib/cfoundry/version.rb
CHANGED
@@ -141,7 +141,7 @@ module CFoundry
|
|
141
141
|
describe "#update!" do
|
142
142
|
describe "changes" do
|
143
143
|
subject { build(:app, :client => client) }
|
144
|
-
let(:response) { {:body => {
|
144
|
+
let(:response) { {:body => {"foo" => "bar"}.to_json} }
|
145
145
|
|
146
146
|
before do
|
147
147
|
stub(client.base).put("v2", "apps", subject.guid, anything) do
|
@@ -251,6 +251,17 @@ module CFoundry
|
|
251
251
|
|
252
252
|
subject.delete!(:recursive => false)
|
253
253
|
end
|
254
|
+
|
255
|
+
describe "#health" do
|
256
|
+
describe "when staging failed for an app" do
|
257
|
+
it "returns 'STAGING FAILED' as state" do
|
258
|
+
stub(client.base).instances(subject.guid) { raise CFoundry::StagingError }
|
259
|
+
stub(subject).state { "STARTED" }
|
260
|
+
|
261
|
+
expect(subject.health).to eq("STAGING FAILED")
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
254
265
|
end
|
255
266
|
end
|
256
267
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.1.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cloud Foundry Team
|
@@ -413,13 +413,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
413
413
|
version: '0'
|
414
414
|
segments:
|
415
415
|
- 0
|
416
|
-
hash:
|
416
|
+
hash: 2533334446138736552
|
417
417
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
418
418
|
none: false
|
419
419
|
requirements:
|
420
|
-
- - ! '
|
420
|
+
- - ! '>'
|
421
421
|
- !ruby/object:Gem::Version
|
422
|
-
version:
|
422
|
+
version: 1.3.1
|
423
423
|
requirements: []
|
424
424
|
rubyforge_project: cfoundry
|
425
425
|
rubygems_version: 1.8.25
|