api_client 0.5.2 → 0.5.3
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: e2ce9166ef3de775d807a9328d7c8d3cd1be6749
|
4
|
+
data.tar.gz: 93e0793ecc97aaba3db316c710a185241324ef42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73082e9434cb43362b144b4c0842eebdec78b156049d577424c6bfa1a6253798e1c697b1a71e75a2d2998b450591fc1227fa94859d804f5f767206ddb3ed85c4
|
7
|
+
data.tar.gz: 17d4779a154186e9cb74f570f94ac8e8420f364125f4d338c1c0dc456fc45a2ee2aed57ed1df34ed0f172d0b7f941d485b1f8492754bc16eabeac0104a904ba1
|
data/lib/api_client/errors.rb
CHANGED
@@ -10,6 +10,7 @@ module ApiClient
|
|
10
10
|
class Redirect < ApiClientError; end
|
11
11
|
class BadRequest < ApiClientError; end
|
12
12
|
class Unsupported < ApiClientError; end
|
13
|
+
class Conflict < ApiClientError; end
|
13
14
|
class ServerError < ApiClientError; end
|
14
15
|
class UnprocessableEntity < ApiClientError; end
|
15
16
|
end
|
data/lib/api_client/version.rb
CHANGED
@@ -126,6 +126,13 @@ describe ApiClient::Connection::Basic do
|
|
126
126
|
}.should raise_error(ApiClient::Errors::Unsupported)
|
127
127
|
end
|
128
128
|
|
129
|
+
it "raises an ApiClient::Errors::Conflict if status is 409" do
|
130
|
+
@response.env[:status] = 409
|
131
|
+
lambda {
|
132
|
+
@instance.send :handle_response, @response
|
133
|
+
}.should raise_error(ApiClient::Errors::Conflict)
|
134
|
+
end
|
135
|
+
|
129
136
|
it "raises an ApiClient::Errors::Unsupported if status is 422" do
|
130
137
|
@response.env[:status] = 422
|
131
138
|
lambda {
|