faraday-conductivity 1.0.0 → 2.0.0
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 +4 -4
- data/.github/workflows/ruby.yml +35 -0
- data/faraday-conductivity.gemspec +1 -1
- data/lib/faraday/conductivity/selective_errors.rb +1 -1
- data/lib/faraday/conductivity/version.rb +1 -1
- data/spec/middleware/selective_errors_spec.rb +22 -0
- metadata +6 -7
- data/.travis.yml +0 -6
- data/gemfiles/faraday_1.0.0.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457e7554e0021ef3fdf94db05ae27cff5177a4a823d4fc90489803f20fc03705
|
4
|
+
data.tar.gz: bcdabbd12bbc7858dfb4eeee28c924869ecf9acf310a22d9ddaf117643ced7d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdfa896556c73282bd31aff257d5191d6d508b29a9afb688d800758c803df709caa2d9d60c741fe3a7378da019dc081123a83220471f213fb562bbd28dfea1e8
|
7
|
+
data.tar.gz: e7005874808c77c260798241746a9a6649602d8e348da7e8a75ab4bd74c0bd2502f5055161304080ff5f5532bc1ad3fe9b65370f9ebf0665e92151eb96e244d6
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "master" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "master" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- name: Set up Ruby
|
30
|
+
uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_dependency "faraday", "~>
|
21
|
+
gem.add_dependency "faraday", "~> 2.0"
|
22
22
|
gem.add_development_dependency "rake"
|
23
23
|
gem.add_development_dependency "rspec", "~> 3"
|
24
24
|
gem.add_development_dependency "pry"
|
@@ -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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iain
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,16 +89,15 @@ executables: []
|
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
92
|
+
- ".github/workflows/ruby.yml"
|
92
93
|
- ".gitignore"
|
93
94
|
- ".rspec"
|
94
|
-
- ".travis.yml"
|
95
95
|
- Appraisals
|
96
96
|
- Gemfile
|
97
97
|
- LICENSE.txt
|
98
98
|
- README.md
|
99
99
|
- Rakefile
|
100
100
|
- faraday-conductivity.gemspec
|
101
|
-
- gemfiles/faraday_1.0.0.gemfile
|
102
101
|
- lib/faraday/conductivity.rb
|
103
102
|
- lib/faraday/conductivity/extended_logging.rb
|
104
103
|
- lib/faraday/conductivity/request_headers.rb
|
@@ -132,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
131
|
- !ruby/object:Gem::Version
|
133
132
|
version: '0'
|
134
133
|
requirements: []
|
135
|
-
rubygems_version: 3.1
|
134
|
+
rubygems_version: 3.0.3.1
|
136
135
|
signing_key:
|
137
136
|
specification_version: 4
|
138
137
|
summary: Extra Faraday middleware, geared towards a service oriented architecture.
|
data/.travis.yml
DELETED