diff --git a/.travis.yml b/.travis.yml index 3a283a1..369fbb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,25 @@ sudo: false matrix: include: + - rvm: 2.6.1 + - rvm: 2.6.0 + - rvm: 2.5.3 + - rvm: 2.5.2 + - rvm: 2.5.1 + - rvm: 2.5.0 + - rvm: 2.4.4 + - rvm: 2.4.3 + - rvm: 2.4.2 - rvm: 2.4.1 - rvm: 2.4.1 script: - bundle exec danger + - rvm: 2.3.6 + - rvm: 2.3.5 + - rvm: 2.3.4 + - rvm: 2.2.7 - rvm: jruby-9.1.12.0 - rvm: jruby-head - - rvm: 2.2.7 - - rvm: 2.3.4 - rvm: rbx-2 - rvm: ruby-head allow_failures: diff --git a/CHANGELOG.md b/CHANGELOG.md index d592dc8..42dc6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### 0.9.1 (Next) +This version is no longer tested with Ruby < 2.2. + +* [#105](https://github.com/codegram/hyperclient/pull/105): Added Danger, PR linter - [@dblock](https://github.com/dblock). +* [#104](https://github.com/codegram/hyperclient/pull/104): fix #to_h and #to_hash on Hyperclient::Resource - [@jufemaiz](https://github.com/jufemaiz) * Your contribution here. ### 0.9.0 (January 10, 2018) diff --git a/test/hyperclient/collection_test.rb b/test/hyperclient/collection_test.rb index fe9b58d..adc0b34 100644 --- a/test/hyperclient/collection_test.rb +++ b/test/hyperclient/collection_test.rb @@ -41,6 +41,12 @@ module Hyperclient end end + describe '#to_h' do + it 'returns the wrapped collection as a hash' do + collection.to_h.must_be_kind_of Hash + end + end + describe 'include?' do it 'returns true for keys that exist' do collection.include?('_links').must_equal true diff --git a/test/hyperclient/resource_test.rb b/test/hyperclient/resource_test.rb index 18c0cc6..92ed0ae 100644 --- a/test/hyperclient/resource_test.rb +++ b/test/hyperclient/resource_test.rb @@ -108,6 +108,18 @@ module Hyperclient resource['foo'].must_equal 'bar' end + describe '#to_h' do + it 'returns the resource attributes as a hash' do + resource.to_h.must_be_kind_of Hash + end + end + + describe '#to_hash' do + it 'returns the resource attributes as a hash' do + resource.to_hash.must_be_kind_of Hash + end + end + describe '#fetch' do it 'returns the value for keys that exist' do resource._attributes.expects(:foo).returns('bar')