routemaster-drain 2.4.3 → 2.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/gemfiles/rails_3.gemfile.lock +2 -2
- data/gemfiles/rails_4.gemfile.lock +2 -2
- data/gemfiles/rails_5.gemfile.lock +2 -2
- data/lib/routemaster/api_client.rb +10 -2
- data/lib/routemaster/drain.rb +1 -1
- data/spec/routemaster/api_client_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb67c5fb3fc8aec8fe43fb6035f99672eb3ce87
|
4
|
+
data.tar.gz: bb35752a729017d5e15d3189ce60f93ef60abd60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b611d4238abac43c10ccd52413541cf272edd293694b42618084bc7393b63f2ca4e27d78e33cf71f4193369c54ae3916a0fca49b376eb99b86d220d7b8dae008
|
7
|
+
data.tar.gz: 004e39f85620152ae1c6275e1edbaa4867badf20b5adda669207079740bc2da746531c86eaf43d0e83da11765b6a5803aff1b4da1fd09cd8bc3ff5a8883446ed
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -72,11 +72,19 @@ module Routemaster
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def post(url, body: {}, headers: {})
|
75
|
-
_request(
|
75
|
+
_wrapped_response _request(
|
76
|
+
:post,
|
77
|
+
url: url,
|
78
|
+
body: body,
|
79
|
+
headers: headers)
|
76
80
|
end
|
77
81
|
|
78
82
|
def patch(url, body: {}, headers: {})
|
79
|
-
_request(
|
83
|
+
_wrapped_response _request(
|
84
|
+
:patch,
|
85
|
+
url: url,
|
86
|
+
body: body,
|
87
|
+
headers: headers)
|
80
88
|
end
|
81
89
|
|
82
90
|
def delete(url, headers: {})
|
data/lib/routemaster/drain.rb
CHANGED
@@ -55,9 +55,19 @@ describe Routemaster::APIClient do
|
|
55
55
|
expect(req.headers).to include('X-Custom-Header')
|
56
56
|
end
|
57
57
|
end
|
58
|
+
end
|
58
59
|
|
60
|
+
shared_examples 'a wrappable response' do
|
59
61
|
context 'when response_class is present' do
|
60
62
|
before do
|
63
|
+
@req = stub_request(:get, /example\.com/).to_return(
|
64
|
+
status: 200,
|
65
|
+
body: { id: 132, type: 'widget' }.to_json,
|
66
|
+
headers: {
|
67
|
+
'content-type' => 'application/json;v=1'
|
68
|
+
}
|
69
|
+
)
|
70
|
+
|
61
71
|
class DummyResponse
|
62
72
|
def initialize(res, client: nil); end
|
63
73
|
def dummy; true; end
|
@@ -75,11 +85,13 @@ describe Routemaster::APIClient do
|
|
75
85
|
describe '#get' do
|
76
86
|
subject { fetcher.get(url, headers: headers) }
|
77
87
|
it_behaves_like 'a GET requester'
|
88
|
+
it_behaves_like 'a wrappable response'
|
78
89
|
end
|
79
90
|
|
80
91
|
describe '#fget' do
|
81
92
|
subject { fetcher.fget(url, headers: headers) }
|
82
93
|
it_behaves_like 'a GET requester'
|
94
|
+
it_behaves_like 'a wrappable response'
|
83
95
|
|
84
96
|
context "when setting callbacks" do
|
85
97
|
before do
|
@@ -147,6 +159,8 @@ describe Routemaster::APIClient do
|
|
147
159
|
subject
|
148
160
|
expect(@post_req).to have_been_requested
|
149
161
|
end
|
162
|
+
|
163
|
+
it_behaves_like 'a wrappable response'
|
150
164
|
end
|
151
165
|
|
152
166
|
describe '#patch' do
|
@@ -166,6 +180,8 @@ describe Routemaster::APIClient do
|
|
166
180
|
subject
|
167
181
|
expect(@patch_req).to have_been_requested
|
168
182
|
end
|
183
|
+
|
184
|
+
it_behaves_like 'a wrappable response'
|
169
185
|
end
|
170
186
|
|
171
187
|
describe '#delete' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routemaster-drain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|