excon-hypermedia 0.5.1 → 0.5.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: f2246dc77b42f4b8b4d785f2436fcdd2baa15439
4
- data.tar.gz: 3263ec98d4fa234ac388bde913084645c5832fc5
3
+ metadata.gz: 658f225688ebcf552f0a36a0cbe53057f53a9e8c
4
+ data.tar.gz: ac4753702b6c6492ebe8aadee78f0d5022cf1906
5
5
  SHA512:
6
- metadata.gz: 34d5efb5420335cfcdcf89fa6600d504c2e14afa7dc2a6baa1bedb7033640a9fed05f73bb942713c2ee4d6d8980b3eb38b37b6bef6ac87967508fce5081c0e35
7
- data.tar.gz: 34172c4a37c20c9d9d887f97f48d7a560e36717f590a59d38a4149f34f728ba6184691afeeaee81553b242730a06082c0823650bf82e5c0e336bf5ba813e22f3
6
+ metadata.gz: dd9e7bd4d055d98b24cd89c592413f1251646709b09041db6ab40c233b32d74a4a2a4e0cda9dc5f6b4bc6d718b5ccbbdb2bffc1ad6b4246243727c92e7706868
7
+ data.tar.gz: 6e89aa76165cfe1f8e11caec5ed679de423b51aa1cf917dd6357a585fe573c5029b750a87727087041488e911579a1ae72f4b97e0daf62cc0a7e2f2d025d61a6
@@ -39,7 +39,7 @@ module Excon
39
39
  end
40
40
 
41
41
  def embedded
42
- datum.dig(:hcp_params, :embedded)
42
+ datum.dig(:hcp_params, :embedded).to_h
43
43
  end
44
44
 
45
45
  def content_type_header
@@ -58,7 +58,7 @@ module Excon
58
58
  end
59
59
 
60
60
  def method_missing(method_name, *_)
61
- _properties.send(method_name)
61
+ _properties.respond_to?(method_name) ? _properties.send(method_name) : super
62
62
  end
63
63
  end
64
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Excon
4
4
  module HyperMedia
5
- VERSION = '0.5.1'
5
+ VERSION = '0.5.2'
6
6
  end
7
7
  end
@@ -20,9 +20,13 @@ module Excon
20
20
  assert response.rel('pump', hcp: true).get[:hcp]
21
21
  end
22
22
 
23
+ def test_hcp_response_without_existing_response
24
+ assert Excon.get('https://example.org/product/bicycle', hcp: true)
25
+ end
26
+
23
27
  def test_hcp_response_with_missing_embedding
24
28
  api = Excon.get('https://www.example.org/api.json')
25
- response = api.rel('product', expand: { uid: 'bicycle' }, rel: true).get
29
+ response = api.rel('product', expand: { uid: 'bicycle' }, hcp: true).get
26
30
 
27
31
  assert_equal nil, response[:hcp]
28
32
  end
@@ -45,5 +45,9 @@ module Excon
45
45
  assert_equal 'world', resource['hello']
46
46
  assert_equal nil, resource['invalid']
47
47
  end
48
+
49
+ def test_correctly_raising_no_method_error
50
+ assert_raises(NoMethodError) { resource.invalid }
51
+ end
48
52
  end
49
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon-hypermedia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean