blanket_wrapper 3.0.0 → 3.0.1

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: 33d01b1274e6100810a9328ec030fe9bf0d1cf91
4
- data.tar.gz: cb1e89db5d84825ca1632cf62b5fd415c862267e
3
+ metadata.gz: a1f42e4930202889333a3585669cffcc68d23410
4
+ data.tar.gz: 2f4d301d33a423d1ffba5e3db4165da3d29f77a3
5
5
  SHA512:
6
- metadata.gz: c97bf1461412fe1bd551f14249abe336f1ef56bd6d81258ca65d55d72673ea9ebf0c1415de9e8fde6cce547765fe317ca726ea3bb96584302899fd2bb773194f
7
- data.tar.gz: e65d51c81612486e8edc269c0f562377efd2976c0f67cb59b3cc8ffa530186b6a3c29a728cf6f57c7e6d8b577bcc9f2e2556b695d39400b34a97bf4a247b80fc
6
+ metadata.gz: 8284341843510f153cc7905b37a56ebf8251b1f77ecf0f9b1c36ef2fce91e5ee4d489fd695dfd2db494386d671dac21a4329cc3d5340dfd4a557c17400f3438f
7
+ data.tar.gz: e437779ab037bd36571027da066e2d9a59df625ad43d81cb70f4494d9cb090b7435f84154a24d69a814d315320934ddee5e53f59504ae0c8ef85a3aa8fbf455e
@@ -1,4 +1,4 @@
1
1
  module Blanket
2
2
  # Current gem version
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
@@ -77,7 +77,7 @@ module Blanket
77
77
  body: options[:body]
78
78
  }.reject { |_, value| value.nil? || value.empty? })
79
79
 
80
- if response.code <= 400
80
+ if response.code < 400
81
81
  body = (response.respond_to? :body) ? response.body : nil
82
82
  (body.is_a? Array) ? body.map(Response.new) : Response.new(body)
83
83
  else
@@ -44,6 +44,16 @@ describe "Blanket::Wrapper" do
44
44
  Blanket::wrap("http://api.example.org")
45
45
  end
46
46
 
47
+ describe "400" do
48
+ before :each do
49
+ stub_request(:get, "http://api.example.org/users").to_return(:status => 400, :body => "You've been met with a terrible fate, haven't you?")
50
+ end
51
+
52
+ it "raises a Blanket::BadRequestError exception" do
53
+ expect { api.users.get }.to raise_exception(Blanket::BadRequest)
54
+ end
55
+ end
56
+
47
57
  describe "500" do
48
58
  before :each do
49
59
  stub_request(:get, "http://api.example.org/users").to_return(:status => 500, :body => "You've been met with a terrible fate, haven't you?")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blanket_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Abrantes