aptible-resource 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea574482695fb823dd1fdd3d91bc50ef35937ffb
4
- data.tar.gz: 1abb9506a424a6046cb673df9c14ee155e5093ab
3
+ metadata.gz: 1130c73b3994bf3cf8c5751389e9b2e23d8a7d33
4
+ data.tar.gz: fbf8224904f5d0cb9ccf65900062e1fcf6034f4e
5
5
  SHA512:
6
- metadata.gz: 0bbeb131ad28239663deaccc453e355d2a9fd30ac1c56cfb8df402de512660151b78271ba3f41794bce44d69ff6800282ad815c1952e53ebceb9da87374f64e3
7
- data.tar.gz: cdfbe033479d431b7e757fcd626b78f46711d6fae7ab05a1c8ff82b5b02e17b74b043d249acdb748eb40d232da74087f57a2375353d63a8438ca642e5ee1cdc4
6
+ metadata.gz: 63aa10d09001fabcc06d7f6669607a2b5cc156d6d61d7913ebf0188e40a9f69c8c11645dee79ce038831327a440e42ff9ed3f380f670f862e228f2eea8f45b1f
7
+ data.tar.gz: 56b1f8cf488d4fccfc63e6eb068f6bba0c049b56a278b6bbab157645b6b35806dc06c3f963fac76bc03c8a576a65c5b08e86153e7971e3e287754c48669856cc
@@ -19,6 +19,10 @@ module Aptible
19
19
  def full_messages
20
20
  @full_messages ||= []
21
21
  end
22
+
23
+ def any?
24
+ full_messages.any?
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Resource
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
@@ -207,10 +207,20 @@ describe Aptible::Resource::Base do
207
207
  expect(subject.create_mainframe.class).to eq Aptible::Resource::Base
208
208
  end
209
209
 
210
+ it 'should have errors present on error' do
211
+ mainframes_link.stub(:create) { fail hyperresource_exception }
212
+ expect(subject.create_mainframe.errors.any?).to be_true
213
+ end
214
+
210
215
  it 'should return the object in the event of successful creation' do
211
216
  mainframes_link.stub(:create) { mainframe }
212
217
  expect(subject.create_mainframe({})).to eq mainframe
213
218
  end
219
+
220
+ it 'should have no errors on successful creation' do
221
+ mainframes_link.stub(:create) { mainframe }
222
+ expect(subject.create_mainframe.errors.any?).to be_false
223
+ end
214
224
  end
215
225
 
216
226
  describe '#create_#{relation}!' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-22 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri_template
@@ -188,7 +188,6 @@ files:
188
188
  - spec/fixtures/api.rb
189
189
  - spec/fixtures/mainframe.rb
190
190
  - spec/fixtures/token.rb
191
- - spec/shared/set_env.rb
192
191
  - spec/spec_helper.rb
193
192
  homepage: https://github.com/aptible/aptible-resource
194
193
  licenses:
@@ -219,5 +218,4 @@ test_files:
219
218
  - spec/fixtures/api.rb
220
219
  - spec/fixtures/mainframe.rb
221
220
  - spec/fixtures/token.rb
222
- - spec/shared/set_env.rb
223
221
  - spec/spec_helper.rb
@@ -1,10 +0,0 @@
1
- def set_env(*args, &block)
2
- hash = args.first.is_a?(Hash) ? args.first : Hash[*args]
3
- old_values = Hash[hash.map { |k, v| [k, ENV[k]] }]
4
- begin
5
- hash.each { |k, v| ENV[k] = v }
6
- yield
7
- ensure
8
- old_values.each { |k, v| ENV[k] = v }
9
- end
10
- end