bootic_client 0.0.10 → 0.0.11

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: f30f8bf8e19051d85d9fc6ac491ee256f96c6d2b
4
- data.tar.gz: bd047d64d66362352aeb8465582c80fa6d834d49
3
+ metadata.gz: b0fe4d2179d68484e7f21e30403d998eb4ae3e8d
4
+ data.tar.gz: 6fdb516289750547db392d3c7028ec28b2cf4fe3
5
5
  SHA512:
6
- metadata.gz: 8d4a3be3b234927fc884f32fd229530547b5a80c2d649782123ce66fbd4ce0cdd204f50ef68ad168ada6c536c745f2286dfaf1b063cf88aae21d17471ddc819a
7
- data.tar.gz: 702fc183dcd174e1129045276e3db6b7366ef7f6e62bab9b6b3001b3b50141c0f68e9b2d81e092ec5bd66164ee513c66ce9b2ea29868050692af7cb436bfa5d9
6
+ metadata.gz: 9093feed798a80679903c1c1d1a47d8b5118fd17ae1cf17f622257a91e3f462fd2087eeaae2aade8a5fa47ea664b9c311ce50b8c4d5dc69e9f80adb7f9adaf99
7
+ data.tar.gz: 1d5058a3d702c82084cf94686165156a518abb929990be3711676c2a467067f0bcf7473600ead9a05e46a945be8fe558448407f92ac3195bc0ffca5d44a90a1a
@@ -31,7 +31,8 @@ module BooticClient
31
31
  attr_reader :curies, :entities
32
32
 
33
33
  def initialize(attrs, client, top = self)
34
- @attrs, @client, @top = attrs, client, top
34
+ @attrs = attrs.kind_of?(Hash) ? attrs : {}
35
+ @client, @top = client, top
35
36
  build!
36
37
  self.extend EnumerableEntity if iterable?
37
38
  end
@@ -1,3 +1,3 @@
1
1
  module BooticClient
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/spec/entity_spec.rb CHANGED
@@ -225,4 +225,16 @@ describe BooticClient::Entity do
225
225
  end
226
226
  end
227
227
 
228
+ context 'empty response' do
229
+ it 'does not break if response is nil' do
230
+ entity = BooticClient::Entity.new(nil, client)
231
+ expect(entity.links).to eql({})
232
+ end
233
+
234
+ it 'does not break if response is empty string' do
235
+ entity = BooticClient::Entity.new('', client)
236
+ expect(entity.links).to eql({})
237
+ end
238
+ end
239
+
228
240
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  requirements: []
223
223
  rubyforge_project:
224
- rubygems_version: 2.2.2
224
+ rubygems_version: 2.4.8
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Official Ruby client for the Bootic API