summaryrefslogtreecommitdiff
path: root/spec/hashie/array_spec.rb
diff options
context:
space:
mode:
authorPeter Goldstein <peter.m.goldstein@gmail.com>2022-01-27 18:59:24 -0800
committerGitHub <noreply@github.com>2022-01-27 18:59:24 -0800
commit3e57eb531f2d028cb56cd1ddab9bb07c70b93abf (patch)
treeca47e5a94dde4b16d7fcd841a9becfb6cb6d9245 /spec/hashie/array_spec.rb
parent4dc015eb522abfaa2323c36024bc214ab8ccb9cc (diff)
downloadhashie-3e57eb531f2d028cb56cd1ddab9bb07c70b93abf.tar.gz
Add Ruby 3.1 to CI (#558)
* Add Ruby 3.1 to CI Update Rubocop for recent Rubies Disable Rubocop run for Rubies before Ruby 2.4 Quote '3.0' in the CI configuration to ensure it loads a 3.0.x Ruby Set RUBYOPT="--disable_error_highlight" so Ruby 3.1 error matchers pass * Add CHANGELOG.md entry * Re-add deleted line from CHANGELOG.md * Set minimum supported Ruby version to 2.4. Remove a number of code bits designed to support Rubies below version 2.4 * Bump version. Remove unneeded require from Gemfile. Add require to spec/support file
Diffstat (limited to 'spec/hashie/array_spec.rb')
-rw-r--r--spec/hashie/array_spec.rb32
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/hashie/array_spec.rb b/spec/hashie/array_spec.rb
index 0c35b1e..ee14a82 100644
--- a/spec/hashie/array_spec.rb
+++ b/spec/hashie/array_spec.rb
@@ -1,28 +1,26 @@
require 'spec_helper'
describe Array do
- with_minimum_ruby('2.3.0') do
- describe '#dig' do
- let(:array) { Hashie::Array.new(%i[a b c]) }
+ describe '#dig' do
+ let(:array) { Hashie::Array.new(%i[a b c]) }
- it 'works with a string index' do
- expect(array.dig('0')).to eq(:a)
- end
+ it 'works with a string index' do
+ expect(array.dig('0')).to eq(:a)
+ end
- it 'works with a numeric index' do
- expect(array.dig(1)).to eq(:b)
- end
+ it 'works with a numeric index' do
+ expect(array.dig(1)).to eq(:b)
+ end
- context 'when array is empty' do
- let(:array) { Hashie::Array.new([]) }
+ context 'when array is empty' do
+ let(:array) { Hashie::Array.new([]) }
- it 'works with a first numeric and next string index' do
- expect(array.dig(0, 'hello')).to eq(nil)
- end
+ it 'works with a first numeric and next string index' do
+ expect(array.dig(0, 'hello')).to eq(nil)
+ end
- it 'throws an error with first string and next numeric index' do
- expect { array.dig('hello', 0) }.to raise_error(TypeError)
- end
+ it 'throws an error with first string and next numeric index' do
+ expect { array.dig('hello', 0) }.to raise_error(TypeError)
end
end
end