Skip to content

Commit

Permalink
Test against Faraday 0.9, 0.17 and 1.0+.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed May 14, 2020
1 parent d11fd8c commit 6ce8a9d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ sudo: false
matrix:
include:
- rvm: 2.6.6
- rvm: 2.5.5
- rvm: 2.4.6
- rvm: 2.4.6
env: FARADAY_VERSION=0.9.0
- rvm: 2.6.6
env: FARADAY_VERSION=0.17.0
- rvm: 2.6.6
env: FARADAY_VERSION="~> 1.0"
- rvm: 2.6.6
script:
- bundle exec danger
- rvm: 2.3.8
- rvm: jruby-9.2.7.0
- rvm: jruby-head
- rvm: 2.3.8
- rvm: ruby-head
allow_failures:
- rvm: ruby-head
- rvm: jruby-head

before_install:
- gem update --system
- gem install bundler

bundler_args: --without development
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### 0.9.4 (Next)

* [#163](https://github.com/codegram/hyperclient/pull/163): Test against Faraday 0.9, 0.17 and 1.0+ - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.9.3 (2020/05/14)
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo['/'] ? repo : "#{repo}/#

source 'https://rubygems.org'

gem 'faraday', ENV['FARADAY_VERSION'] if ENV.key?('FARADAY_VERSION')

gemspec

group :development do
Expand Down
7 changes: 6 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

MiniTest::Test.class_eval do
def stub_request(conn, adapter_class = Faraday::Adapter::Test, &stubs_block)
conn.builder.adapter adapter_class, &stubs_block
adapter_handler = conn.builder.handlers.find { |h| h.klass < Faraday::Adapter }
if adapter_handler
conn.builder.swap(adapter_handler, adapter_class, &stubs_block)
else
conn.builder.adapter adapter_class, &stubs_block
end
end
end

0 comments on commit 6ce8a9d

Please sign in to comment.