restful_resource 2.2.0 → 2.2.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bde6cf5ec5aad431ca3e9d06e2fad1787d8060dd
|
4
|
+
data.tar.gz: 6d9a8f2062d2952df9b6d3f3fc1413d093469046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8f4f98f262ef51cf3219acacffc48b2cc1e74d453fa16f71bf224bd49b5238966b30bc9c435f0f76b7d8ea09a2491c259b6166b28edd230cfd6da319a78a56
|
7
|
+
data.tar.gz: 1e73b6228ba3143e96eec6f2d98ea2014d8061654f30fc34bdf48e8749c07479a1a40cccd5226cd2afc1f12aeb73412f70429224632772d003dc84bdea97a621
|
@@ -28,6 +28,8 @@ module RestfulResource
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
class Conflict < HttpError; end
|
32
|
+
|
31
33
|
class RetryableError < HttpError; end
|
32
34
|
|
33
35
|
class OtherHttpError < HttpError
|
@@ -208,6 +210,7 @@ module RestfulResource
|
|
208
210
|
raise ClientError.new(request) unless response
|
209
211
|
case response[:status]
|
210
212
|
when 404 then raise HttpClient::ResourceNotFound.new(request, response)
|
213
|
+
when 409 then raise HttpClient::Conflict.new(request, response)
|
211
214
|
when 422 then raise HttpClient::UnprocessableEntity.new(request, response)
|
212
215
|
when 502 then raise HttpClient::BadGateway.new(request, response)
|
213
216
|
when 503 then raise HttpClient::ServiceUnavailable.new(request, response)
|
@@ -57,6 +57,14 @@ RSpec.describe RestfulResource::HttpClient do
|
|
57
57
|
expect(response.status).to eq 200
|
58
58
|
end
|
59
59
|
|
60
|
+
it 'put should raise error 409' do
|
61
|
+
connection = faraday_connection do |stubs|
|
62
|
+
stubs.put('http://httpbin.org/status/409') { |env| [409, {}, nil] }
|
63
|
+
end
|
64
|
+
|
65
|
+
expect { http_client(connection).put('http://httpbin.org/status/409') }.to raise_error(RestfulResource::HttpClient::Conflict)
|
66
|
+
end
|
67
|
+
|
60
68
|
it 'put should raise error 422' do
|
61
69
|
connection = faraday_connection do |stubs|
|
62
70
|
stubs.put('http://httpbin.org/status/422') { |env| [422, {}, nil] }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Santoro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|