my_api_client 0.10.1 → 0.10.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b51c7b894daf22bf34e5ee6e578a454a0937baaa65b81b57beef81bbc6987c8
|
4
|
+
data.tar.gz: 112cba8ee0ef065e785085add92835cb11a4d09b25337f0af0fc6714c72b138d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d8bbf5fbaf7fddb6b862f1f3b16f0747b3f6d67d1c1ab14d3587bffda42357718d029fa96761b8ef3fa69dd6c2e7088fc3e283ad152028d16f66e95411268b
|
7
|
+
data.tar.gz: 75f812f2f1d6bc99b9a2c482942c395b4b5ca96d972799013818f08ad1337533b3bcdadb9734a21ca1f323ae420b8b245b81f2261a45534f8dbe7d49473403e0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## 0.10.2 (Oct 23, 2019)
|
4
|
+
|
5
|
+
### Bugfix
|
6
|
+
|
7
|
+
* Ignore error handling when using request to matcher ([#130](git@github.com:ryz310/my_api_client/pull/130))
|
8
|
+
* Fix `be_handled_as_an_error` description ([#131](git@github.com:ryz310/my_api_client/pull/131))
|
9
|
+
|
3
10
|
## 0.10.1 (Oct 23, 2019)
|
4
11
|
|
5
12
|
### Feature
|
data/Gemfile.lock
CHANGED
@@ -21,7 +21,7 @@ RSpec::Matchers.define :be_handled_as_an_error do |expected_error_class|
|
|
21
21
|
chain :when_receive, :expected_response
|
22
22
|
|
23
23
|
description do
|
24
|
-
message = "be handled as #{expected_error_class}"
|
24
|
+
message = "be handled as #{expected_error_class || 'an error'}"
|
25
25
|
message += " after retry #{retry_count} times" unless retry_count.nil?
|
26
26
|
message
|
27
27
|
end
|
@@ -52,7 +52,7 @@ RSpec::Matchers.define :be_handled_as_an_error do |expected_error_class|
|
|
52
52
|
headers: expected_response[:headers] || {},
|
53
53
|
body: expected_response[:body] || nil
|
54
54
|
)
|
55
|
-
@sawyer = instance_double(Sawyer::Agent, call: response
|
55
|
+
@sawyer = instance_double(Sawyer::Agent, call: response)
|
56
56
|
allow(Sawyer::Agent).to receive(:new).and_return(sawyer)
|
57
57
|
end
|
58
58
|
|
@@ -27,7 +27,7 @@ RSpec::Matchers.define :request_to do |expected_method, expected_url|
|
|
27
27
|
query: options[:query],
|
28
28
|
}.compact
|
29
29
|
end.and_return(dummy_response)
|
30
|
-
api_request
|
30
|
+
safe_execution(api_request)
|
31
31
|
@expected == @actual
|
32
32
|
end
|
33
33
|
|
@@ -44,6 +44,13 @@ RSpec::Matchers.define :request_to do |expected_method, expected_url|
|
|
44
44
|
MESSAGE
|
45
45
|
end
|
46
46
|
|
47
|
+
# To ignore error handling
|
48
|
+
def safe_execution(api_request)
|
49
|
+
api_request.call
|
50
|
+
rescue MyApiClient::Error
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
|
47
54
|
def request_line(method, url)
|
48
55
|
"#{method.upcase} #{url}"
|
49
56
|
end
|