faraday-conductivity 1.0.0 → 1.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e393883d3c0b3a50660e6dafbc81b71fcb7248369194c7f2e1b1680e803875
|
4
|
+
data.tar.gz: cf92d88b08e4e9eba93b56483cd3eff818f419f702dafe9d8e4ae4cc195ef507
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 833765770451c7113b605c449a8ccdf66a8b3e763ca9ad1458dcf227a3a599b160948cc10ec472491d703dc68fa841928b83ca126c908c71e28d7d73686c03b1
|
7
|
+
data.tar.gz: 7bd40193cd8be6a51a642a1a43e5320354a3af7535a12cfee7a0a875547340a6d58273c987e86f847dfbdaee84f0206e7be76d801ecb8e66dd9172bf684f9616
|
@@ -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
|