active_rest_client 0.9.71 → 0.9.72

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: 0b3b9e60fbe7fcac66d2abb8fdfca13ffc67a4af
4
- data.tar.gz: 7193b387bb571a86de67db438a993357571490d6
3
+ metadata.gz: 979311b6e72a88f984bed1b34c1c3fd07dde2a9d
4
+ data.tar.gz: 327b472ac5851bff68e3d74dbc7b0e127a2b85ca
5
5
  SHA512:
6
- metadata.gz: d1fcb9dd01cc0a5bd476fcb1733a421ee8a490e94bb695593469c1cfc9675a5285ad43f946b557d6ec064d5dc2d1f643504cbae03b45fa88b12a2bc823515f58
7
- data.tar.gz: 1ce2d5a2bcbe5ff8ffd2ea4fcace14f25c98c234b5c8cfffd90828b4304a3e365611986994607e6412ebd70313ea7737ad539d18ea4dca638f3fd5db726b35e9
6
+ metadata.gz: 9e9fa00e1d9530c2da3b2783fdb6c02db11c10ad251dc0e6d242d4f11a4d95418583a0e1e2d24784f9487a85e0f12b381fc04f492976b6e5f9fccb6b4445c70b
7
+ data.tar.gz: 1f0d887ec3337ee7fb414f8788e36faa96eaf05fb9a9b9cc17991e3fdd8b1cebdfb7cee808d63dcd6ab63f35cc633dd6c1e6c7f83f9491a00dc88d1ac35de5ca
@@ -24,13 +24,13 @@ module ActiveRestClient
24
24
  def make_safe_request(path, &block)
25
25
  block.call
26
26
  rescue Faraday::TimeoutError
27
- raise ActiveRestClient::TimeoutException.new("Timed out getting #{@base_url}#{path}")
27
+ raise ActiveRestClient::TimeoutException.new("Timed out getting #{full_url(path)}")
28
28
  rescue Faraday::ConnectionFailed
29
29
  begin
30
30
  reconnect
31
31
  block.call
32
32
  rescue Faraday::ConnectionFailed
33
- raise ActiveRestClient::ConnectionFailedException.new("Unable to connect to #{@base_url}#{path}")
33
+ raise ActiveRestClient::ConnectionFailedException.new("Unable to connect to #{full_url(path)}")
34
34
  end
35
35
  end
36
36
 
@@ -74,5 +74,9 @@ module ActiveRestClient
74
74
  Faraday.new({url: @base_url}, &ActiveRestClient::Base.faraday_config)
75
75
  end
76
76
 
77
+
78
+ def full_url(path)
79
+ @session.build_url(path).to_s
80
+ end
77
81
  end
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRestClient
2
- VERSION = "0.9.71"
2
+ VERSION = "0.9.72"
3
3
  end
@@ -108,4 +108,13 @@ describe ActiveRestClient::Connection do
108
108
  expect { @connection.get("/foo") }.to raise_error(ActiveRestClient::TimeoutException)
109
109
  end
110
110
 
111
+ it "should raise an exception on timeout" do
112
+ stub_request(:get, "www.example.com/foo").to_timeout
113
+ begin
114
+ @connection.get("foo")
115
+ fail
116
+ rescue ActiveRestClient::TimeoutException => timeout
117
+ expect(timeout.message).to eq("Timed out getting http://www.example.com/foo")
118
+ end
119
+ end
111
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.71
4
+ version: 0.9.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Which Ltd