faraday-conductivity 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 4b7daa7d2c2b8b16dc880bfb8ac956542d2db10f299a2821f1d1df8323c88e96
4
- data.tar.gz: fa99a8e801b0cab12612be567d7558612e6da81a7c849a5cfd0a0a77358b4f42
3
+ metadata.gz: d9e393883d3c0b3a50660e6dafbc81b71fcb7248369194c7f2e1b1680e803875
4
+ data.tar.gz: cf92d88b08e4e9eba93b56483cd3eff818f419f702dafe9d8e4ae4cc195ef507
5
5
  SHA512:
6
- metadata.gz: 26827ab33d953a9bd4ea2212cdaf9c2ffb3f7537f79c6143496976c38a5c4d55bb3a55e9315f6f169e802aba5165acd54c2a7ffee56a65bdb3c4254405749fae
7
- data.tar.gz: f16d6d9307c8747ef3510fa447c07fdb5ed89040fad92fc7ff5bdbb87e0d8b199aa9d2979d7030cb54183bbae9cbe03fcdb9f70d82b9edb0494fc87c43010f30
6
+ metadata.gz: 833765770451c7113b605c449a8ccdf66a8b3e763ca9ad1458dcf227a3a599b160948cc10ec472491d703dc68fa841928b83ca126c908c71e28d7d73686c03b1
7
+ data.tar.gz: 7bd40193cd8be6a51a642a1a43e5320354a3af7535a12cfee7a0a875547340a6d58273c987e86f847dfbdaee84f0206e7be76d801ecb8e66dd9172bf684f9616
@@ -59,7 +59,7 @@ module Faraday
59
59
 
60
60
  def initialize(app, options = {})
61
61
  @app = app
62
- @on = options.fetch(:on) { ClientErrorStatuses }
62
+ @on = options.fetch(:on) { ClientErrorStatuses.to_a + ServerErrorStatuses.to_a }
63
63
  @except = options.fetch(:except) { [] }
64
64
  end
65
65
 
@@ -1,5 +1,5 @@
1
1
  module Faraday
2
2
  module Conductivity
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -2,6 +2,28 @@ RSpec.describe Faraday::Conductivity::SelectiveErrors do
2
2
 
3
3
  subject(:request_headers) { response.env[:request_headers] }
4
4
 
5
+ context 'default range' do
6
+ before { apply_selective_errors({}) }
7
+
8
+ it 'includes client errors' do
9
+ expect { response_with_status(400) }.to raise_error Faraday::BadRequestError
10
+ expect { response_with_status(450) }.to raise_error Faraday::ClientError
11
+ expect { response_with_status(499) }.to raise_error Faraday::ClientError
12
+ end
13
+
14
+ it 'includes server errors' do
15
+ expect { response_with_status(500) }.to raise_error Faraday::ServerError
16
+ expect { response_with_status(550) }.to raise_error Faraday::ServerError
17
+ expect { response_with_status(599) }.to raise_error Faraday::ServerError
18
+ end
19
+
20
+ it 'does not include non-client non-server errors' do
21
+ expect { response_with_status(100) }.not_to raise_error
22
+ expect { response_with_status(200) }.not_to raise_error
23
+ expect { response_with_status(305) }.not_to raise_error
24
+ end
25
+ end
26
+
5
27
  it "raises an exception if the error is inside the :on argument" do
6
28
  apply_selective_errors on: 407..409
7
29
  expect { response_with_status(408) }.to raise_error Faraday::ClientError
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-conductivity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iain