api_client 0.5.2 → 0.5.3

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
  SHA1:
3
- metadata.gz: dfe39a32ee0c3b57e6b5c2155a100fdbdb63f61b
4
- data.tar.gz: 292919f33b87cc0e7994c6d58f31496ff179d8b3
3
+ metadata.gz: e2ce9166ef3de775d807a9328d7c8d3cd1be6749
4
+ data.tar.gz: 93e0793ecc97aaba3db316c710a185241324ef42
5
5
  SHA512:
6
- metadata.gz: 8aae61eda65f0504ddc137bdf4feb6146eafea25a91ce1eac4cec4c2496c8eecaef1e05006cc0117d740f1b7b2016b00c32dce6b498744c92f99ec9212340798
7
- data.tar.gz: 1c13ec9d84f4879e9f8a648a64db320dfa083c1f10e6a21c632033dccc5536a82c0de5dd34964d9cde944aa13323dd83178c93e5339289cc2651cf7ef23bda54
6
+ metadata.gz: 73082e9434cb43362b144b4c0842eebdec78b156049d577424c6bfa1a6253798e1c697b1a71e75a2d2998b450591fc1227fa94859d804f5f767206ddb3ed85c4
7
+ data.tar.gz: 17d4779a154186e9cb74f570f94ac8e8420f364125f4d338c1c0dc456fc45a2ee2aed57ed1df34ed0f172d0b7f941d485b1f8492754bc16eabeac0104a904ba1
@@ -87,6 +87,8 @@ module ApiClient
87
87
  raise ApiClient::Errors::BadRequest
88
88
  when 406
89
89
  raise ApiClient::Errors::Unsupported
90
+ when 409
91
+ raise ApiClient::Errors::Conflict
90
92
  when 422
91
93
  raise ApiClient::Errors::UnprocessableEntity.new(response.body)
92
94
  when 300..399
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ApiClient
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -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 {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Bunsch