faraday-conductivity 1.0.0 → 2.0.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
  SHA256:
3
- metadata.gz: 4b7daa7d2c2b8b16dc880bfb8ac956542d2db10f299a2821f1d1df8323c88e96
4
- data.tar.gz: fa99a8e801b0cab12612be567d7558612e6da81a7c849a5cfd0a0a77358b4f42
3
+ metadata.gz: 457e7554e0021ef3fdf94db05ae27cff5177a4a823d4fc90489803f20fc03705
4
+ data.tar.gz: bcdabbd12bbc7858dfb4eeee28c924869ecf9acf310a22d9ddaf117643ced7d4
5
5
  SHA512:
6
- metadata.gz: 26827ab33d953a9bd4ea2212cdaf9c2ffb3f7537f79c6143496976c38a5c4d55bb3a55e9315f6f169e802aba5165acd54c2a7ffee56a65bdb3c4254405749fae
7
- data.tar.gz: f16d6d9307c8747ef3510fa447c07fdb5ed89040fad92fc7ff5bdbb87e0d8b199aa9d2979d7030cb54183bbae9cbe03fcdb9f70d82b9edb0494fc87c43010f30
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", "~> 1.0"
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"
@@ -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 = "2.0.0"
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: 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: 2020-05-26 00:00:00.000000000 Z
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: '1.0'
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: '1.0'
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.2
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
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- - 2.7.0
5
- gemfile:
6
- - gemfiles/faraday_1.0.0.gemfile
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 1.0.0"
6
-
7
- gemspec path: "../"