excon-hypermedia 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/excon-hypermedia.gemspec +2 -2
- data/lib/excon/hypermedia/response.rb +1 -1
- data/lib/excon/hypermedia/version.rb +1 -1
- data/test/excon/integration_test.rb +7 -0
- data/test/test_helper.rb +7 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29b47d541b2f707b73bc69d61e0cc0a4682104c2
|
|
4
|
+
data.tar.gz: fd216f256e5b926307bdb4dd59dd58774a3a2753
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85536ac1d03e1179c50c66de11085db9b6004e19a951896d01cf8fab7661d78188668e5ba6a116466d3161c54e2132e0f421a14f437c41cf2c8cfdb6d10a41f4
|
|
7
|
+
data.tar.gz: 36eeaa8528105c6dd4d1614fed06a56e782e485238055890c123a21d010acd3d80eaa9996e0a59c011d2846cd8e60037142d00476952ef92a93d167ff4baccca
|
data/excon-hypermedia.gemspec
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
#
|
|
2
|
+
# encoding: utf-8
|
|
3
3
|
lib = File.expand_path('../lib', __FILE__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'excon/hypermedia/version'
|
|
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.add_development_dependency 'm', '~> 1.5'
|
|
26
26
|
|
|
27
27
|
spec.add_dependency 'excon', '~> 0.49'
|
|
28
|
-
spec.add_dependency 'excon-addressable', '~> 0.
|
|
28
|
+
spec.add_dependency 'excon-addressable', '~> 0.3'
|
|
29
29
|
end
|
|
@@ -92,6 +92,13 @@ module Excon
|
|
|
92
92
|
assert_equal data(:front_wheel)['position'], response.resource._embedded.wheels.first.position
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
+
def test_request_with_json_content_type
|
|
96
|
+
api = Excon.get('https://www.example.org/api_v2.json', hypermedia: true)
|
|
97
|
+
response = api.rel('product', expand: { uid: 'bicycle' }).get
|
|
98
|
+
|
|
99
|
+
assert response.body.include?('https://www.example.org/product/bicycle')
|
|
100
|
+
end
|
|
101
|
+
|
|
95
102
|
def teardown
|
|
96
103
|
Excon.stubs.clear
|
|
97
104
|
end
|
data/test/test_helper.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Excon
|
|
|
23
23
|
Excon.stub({ method: :get, path: '/product/bicycle/wheels/rear' }, response.merge(body: rear_wheel_body))
|
|
24
24
|
Excon.stub({ method: :get, path: '/product/pump' }, response.merge(body: pump_body))
|
|
25
25
|
Excon.stub({ method: :get, path: '/product/handlebar' }, response.merge(body: handlebar_body))
|
|
26
|
+
Excon.stub({ method: :get, path: '/api_v2.json' }, body: api_body, headers: { 'Content-Type' => 'application/json' })
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
def teardown
|
|
@@ -92,7 +93,9 @@ module Excon
|
|
|
92
93
|
<<~EOF
|
|
93
94
|
{
|
|
94
95
|
"_links": {
|
|
95
|
-
"self":
|
|
96
|
+
"self": {
|
|
97
|
+
"href": "https://www.example.org/product/handlebar"
|
|
98
|
+
}
|
|
96
99
|
},
|
|
97
100
|
"material": "Carbon fiber",
|
|
98
101
|
"reach": "75mm",
|
|
@@ -105,7 +108,9 @@ module Excon
|
|
|
105
108
|
<<~EOF
|
|
106
109
|
{
|
|
107
110
|
"_links": {
|
|
108
|
-
"self":
|
|
111
|
+
"self": {
|
|
112
|
+
"href": "https://www.example.org/product/pump"
|
|
113
|
+
}
|
|
109
114
|
},
|
|
110
115
|
"weight": "2kg",
|
|
111
116
|
"type": "Floor Pump",
|
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.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-05-
|
|
12
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|
|
@@ -115,14 +115,14 @@ dependencies:
|
|
|
115
115
|
requirements:
|
|
116
116
|
- - "~>"
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: '0.
|
|
118
|
+
version: '0.3'
|
|
119
119
|
type: :runtime
|
|
120
120
|
prerelease: false
|
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
|
122
122
|
requirements:
|
|
123
123
|
- - "~>"
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: '0.
|
|
125
|
+
version: '0.3'
|
|
126
126
|
description: Excon, with Hypermedia traversing baked in.
|
|
127
127
|
email:
|
|
128
128
|
- jean@mertz.fm
|
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
176
176
|
version: '0'
|
|
177
177
|
requirements: []
|
|
178
178
|
rubyforge_project:
|
|
179
|
-
rubygems_version: 2.
|
|
179
|
+
rubygems_version: 2.6.4
|
|
180
180
|
signing_key:
|
|
181
181
|
specification_version: 4
|
|
182
182
|
summary: Excon, with Hypermedia traversing baked in.
|