tddium_client 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tddium_client (0.4.2)
4
+ tddium_client (0.4.3)
5
5
  httpclient (>= 2.2.5)
6
6
  json
7
7
 
@@ -12,7 +12,7 @@ GEM
12
12
  crack (0.3.1)
13
13
  diff-lcs (1.1.3)
14
14
  fakefs (0.4.0)
15
- httpclient (2.3.3)
15
+ httpclient (2.3.4.1)
16
16
  json (1.8.0)
17
17
  multi_json (1.3.6)
18
18
  rack (1.4.1)
@@ -131,7 +131,7 @@ module TddiumClient
131
131
 
132
132
  begin
133
133
  http = @client.send(method, tddium_uri(api_path), :body => call_params.to_json, :header => headers)
134
- rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, OpenSSL::SSL::SSLError, OpenSSL::SSL::Session::SessionError
134
+ rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, OpenSSL::SSL::SSLError, OpenSSL::SSL::Session::SessionError, HTTPClient::TimeoutError, HTTPClient::BadResponseError
135
135
  tries += 1
136
136
  delay = (tries>>1)*0.05*rand()
137
137
  Kernel.sleep(delay)
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2011, 2012 Solano Labs All Rights Reserved
2
2
 
3
3
  module TddiumClient
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
@@ -309,6 +309,15 @@ describe "TddiumClient" do
309
309
  it_behaves_like "retry on exception" do
310
310
  let (:raised_exception) { OpenSSL::SSL::Session::SessionError }
311
311
  end
312
+ it_behaves_like "retry on exception" do
313
+ let (:raised_exception) { HTTPClient::ReceiveTimeoutError }
314
+ end
315
+ it_behaves_like "retry on exception" do
316
+ let (:raised_exception) { HTTPClient::ConnectTimeoutError }
317
+ end
318
+ it_behaves_like "retry on exception" do
319
+ let (:raised_exception) { HTTPClient::BadResponseError.new(double) }
320
+ end
312
321
  end
313
322
 
314
323
  context "('#{EXAMPLE_HTTP_METHOD}', '#{EXAMPLE_TDDIUM_RESOURCE}', {}, #{EXAMPLE_API_KEY}) # with api_key" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jay Moorthi
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-06-14 00:00:00 -07:00
17
+ date: 2013-09-29 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency