gds-api-adapters 19.1.0 → 19.2.0

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: 685025d180b46ecc7468390d5a17adfced252e6f
4
- data.tar.gz: a7d382fa6bb62a52a2211cd746d334a292ca3633
3
+ metadata.gz: 2d7a14cdb0314fd0e249e1d7a958e436a9423a0a
4
+ data.tar.gz: 6c964b35d713dd3ffb6de9d2c4e4ec680ce84e2f
5
5
  SHA512:
6
- metadata.gz: e421a41cb2f5a2082a984faf196e910b2ad3232097507e420abcf7f95618dfc194ec8e0508def31ec4406f6a5f65cf07d671e915573ba5f6209726691f131d35
7
- data.tar.gz: 8490c07db3fe156ecda84e21541a1ef94450310ebca5890798ee37839c839a56ce25f4a90831ada11a0930387c0a0aa45f7c9f9268ba315d56d342d1d05c8f0a
6
+ metadata.gz: aa837106a456ce8863e297588642e1b16caf416da36cbdff0d80fce1e30922450cb49260eee9d6bb18ca889546d2566da40594232dfe1e012b5f6a3b7a7c7fcf
7
+ data.tar.gz: b42cbd5d65b6243174c9804fc9f3d676ca7a518a4430b0c574b3417d27420f58b9af8a1b902b0954f623bf6ce6bd01fe908295f263abff9e4d5ea06aafb9f93b
@@ -33,6 +33,9 @@ module GdsApi
33
33
  class HTTPGone < HTTPClientError
34
34
  end
35
35
 
36
+ class HTTPForbidden < HTTPClientError
37
+ end
38
+
36
39
  class NoBearerToken < BaseError; end
37
40
 
38
41
  module ExceptionHandling
@@ -51,6 +54,8 @@ module GdsApi
51
54
  code = error.http_code
52
55
 
53
56
  case code
57
+ when 403
58
+ GdsApi::HTTPForbidden.new(code, message, details)
54
59
  when 404
55
60
  GdsApi::HTTPNotFound.new(code, message, details)
56
61
  when 410
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '19.1.0'
2
+ VERSION = '19.2.0'
3
3
  end
@@ -326,6 +326,14 @@ class JsonClientTest < MiniTest::Spec
326
326
  end
327
327
  end
328
328
 
329
+ def test_get_bang_should_raise_http_forbidden_if_403_returned_from_endpoint
330
+ url = "http://some.endpoint/some.json"
331
+ stub_request(:get, url).to_return(:body => "{}", :status => 403)
332
+ assert_raises GdsApi::HTTPForbidden do
333
+ @client.get_json!(url)
334
+ end
335
+ end
336
+
329
337
  def test_get_should_be_nil_if_404_returned_from_endpoint
330
338
  url = "http://some.endpoint/some.json"
331
339
  stub_request(:get, url).to_return(:body => "{}", :status => 404)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.1.0
4
+ version: 19.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek