Skip to content

Commit ed9a796

Browse files
authored
Merge pull request #163 from dblock/fix-build
Fix: build with newer minitest and Faraday that come by default.
2 parents 491b493 + 6ce8a9d commit ed9a796

15 files changed

+190
-195
lines changed

.rubocop_todo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2020-05-10 19:37:12 -0400 using RuboCop version 0.81.0.
3+
# on 2020-05-14 17:08:39 -0400 using RuboCop version 0.81.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -59,7 +59,7 @@ Style/MethodMissingSuper:
5959
Exclude:
6060
- 'lib/hyperclient/collection.rb'
6161

62-
# Offense count: 91
62+
# Offense count: 94
6363
# Cop supports --auto-correct.
6464
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
6565
# URISchemes: http, https

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@ sudo: false
55
matrix:
66
include:
77
- rvm: 2.6.6
8-
- rvm: 2.5.5
9-
- rvm: 2.4.6
10-
- rvm: 2.4.6
8+
env: FARADAY_VERSION=0.9.0
9+
- rvm: 2.6.6
10+
env: FARADAY_VERSION=0.17.0
11+
- rvm: 2.6.6
12+
env: FARADAY_VERSION="~> 1.0"
13+
- rvm: 2.6.6
1114
script:
1215
- bundle exec danger
16+
- rvm: 2.3.8
1317
- rvm: jruby-9.2.7.0
1418
- rvm: jruby-head
15-
- rvm: 2.3.8
1619
- rvm: ruby-head
1720
allow_failures:
1821
- rvm: ruby-head
1922
- rvm: jruby-head
2023

21-
before_install:
22-
- gem update --system
23-
- gem install bundler
24-
2524
bundler_args: --without development

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### 0.9.4 (Next)
44

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

78
### 0.9.3 (2020/05/14)

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo['/'] ? repo : "#{repo}/#
33

44
source 'https://rubygems.org'
55

6+
gem 'faraday', ENV['FARADAY_VERSION'] if ENV.key?('FARADAY_VERSION')
7+
68
gemspec
79

810
group :development do

test/faraday/connection_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Faraday
1414
it 'inserts the DigestAuth middleware at the top' do
1515
connection.digest_auth('user', 'password')
1616

17-
connection.builder.handlers.first.klass.must_equal Faraday::Request::DigestAuth
17+
_(connection.builder.handlers.first.klass).must_equal Faraday::Request::DigestAuth
1818
end
1919

2020
it 'passes the user and password to the middleware' do

test/hyperclient/attributes_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ module Hyperclient
1212
end
1313

1414
it 'does not set _links as an attribute' do
15-
attributes.wont_respond_to :_links
15+
_(attributes).wont_respond_to :_links
1616
end
1717

1818
it 'does not set _embedded as an attribute' do
19-
attributes.wont_respond_to :_embedded
19+
_(attributes).wont_respond_to :_embedded
2020
end
2121

2222
it 'sets normal attributes' do
23-
attributes.must_respond_to :permitted
24-
attributes.permitted.must_equal true
23+
_(attributes).must_respond_to :permitted
24+
_(attributes.permitted).must_equal true
2525

26-
attributes.must_respond_to :title
27-
attributes.title.must_equal 'Real World ASP.NET MVC3'
26+
_(attributes).must_respond_to :title
27+
_(attributes.title).must_equal 'Real World ASP.NET MVC3'
2828
end
2929

3030
# Underscores should be allowed per http://tools.ietf.org/html/draft-kelly-json-hal#appendix-B.4
3131
it 'sets _hidden_attribute as an attribute' do
32-
attributes.must_respond_to :_hidden_attribute
33-
attributes._hidden_attribute.must_equal 'useful value'
32+
_(attributes).must_respond_to :_hidden_attribute
33+
_(attributes._hidden_attribute).must_equal 'useful value'
3434
end
3535

3636
it 'is a collection' do
37-
Attributes.ancestors.must_include Collection
37+
_(Attributes.ancestors).must_include Collection
3838
end
3939
end
4040
end

test/hyperclient/collection_test.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,61 @@ module Hyperclient
1212
end
1313

1414
it 'exposes the collection as methods' do
15-
collection.title.must_equal 'Real World ASP.NET MVC3'
16-
collection.description.must_match(/production/)
17-
collection.permitted.must_equal true
15+
_(collection.title).must_equal 'Real World ASP.NET MVC3'
16+
_(collection.description).must_match(/production/)
17+
_(collection.permitted).must_equal true
1818
end
1919

2020
it 'exposes collection as a hash' do
21-
collection['title'].must_equal 'Real World ASP.NET MVC3'
22-
collection['description'].must_match(/production/)
23-
collection['permitted'].must_equal true
21+
_(collection['title']).must_equal 'Real World ASP.NET MVC3'
22+
_(collection['description']).must_match(/production/)
23+
_(collection['permitted']).must_equal true
2424
end
2525

2626
it 'correctly responds to methods' do
27-
collection.must_respond_to :title
27+
_(collection).must_respond_to :title
2828
end
2929

3030
it 'acts as enumerable' do
3131
names = collection.map do |name, _value|
3232
name
3333
end
3434

35-
names.must_equal %w[_links title description permitted _hidden_attribute _embedded]
35+
_(names).must_equal %w[_links title description permitted _hidden_attribute _embedded]
3636
end
3737

3838
describe '#to_hash' do
3939
it 'returns the wrapped collection as a hash' do
40-
collection.to_hash.must_be_kind_of Hash
40+
_(collection.to_hash).must_be_kind_of Hash
4141
end
4242
end
4343

4444
describe 'include?' do
4545
it 'returns true for keys that exist' do
46-
collection.include?('_links').must_equal true
46+
_(collection.include?('_links')).must_equal true
4747
end
4848

4949
it 'returns false for missing keys' do
50-
collection.include?('missing key').must_equal false
50+
_(collection.include?('missing key')).must_equal false
5151
end
5252
end
5353

5454
describe '#fetch' do
5555
it 'returns the value for keys that exist' do
56-
collection.fetch('title').must_equal 'Real World ASP.NET MVC3'
56+
_(collection.fetch('title')).must_equal 'Real World ASP.NET MVC3'
5757
end
5858

5959
it 'raises an error for missing keys' do
60-
proc { collection.fetch('missing key') }.must_raise KeyError
60+
_(proc { collection.fetch('missing key') }).must_raise KeyError
6161
end
6262

6363
describe 'with a default value' do
6464
it 'returns the value for keys that exist' do
65-
collection.fetch('title', 'default').must_equal 'Real World ASP.NET MVC3'
65+
_(collection.fetch('title', 'default')).must_equal 'Real World ASP.NET MVC3'
6666
end
6767

6868
it 'returns the default value for missing keys' do
69-
collection.fetch('missing key', 'default').must_equal 'default'
69+
_(collection.fetch('missing key', 'default')).must_equal 'default'
7070
end
7171
end
7272
end

test/hyperclient/curie_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ module Hyperclient
1111
it 'returns true if the curie is templated' do
1212
curie = Curie.new({ 'name' => 'image', 'templated' => true }, entry_point)
1313

14-
curie.templated?.must_equal true
14+
_(curie.templated?).must_equal true
1515
end
1616

1717
it 'returns false if the curie is not templated' do
1818
curie = Curie.new({ 'name' => 'image' }, entry_point)
1919

20-
curie.templated?.must_equal false
20+
_(curie.templated?).must_equal false
2121
end
2222
end
2323

@@ -26,12 +26,12 @@ module Hyperclient
2626
end
2727
describe '_name' do
2828
it 'returns curie name' do
29-
curie.name.must_equal 'image'
29+
_(curie.name).must_equal 'image'
3030
end
3131
end
3232
describe 'expand' do
3333
it 'expands link' do
34-
curie.expand('thumbnail').must_equal '/images/thumbnail'
34+
_(curie.expand('thumbnail')).must_equal '/images/thumbnail'
3535
end
3636
end
3737
end

0 commit comments

Comments
 (0)