summaryrefslogtreecommitdiff
path: root/spec/hashie/extensions/indifferent_access_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/hashie/extensions/indifferent_access_spec.rb')
-rw-r--r--spec/hashie/extensions/indifferent_access_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/hashie/extensions/indifferent_access_spec.rb b/spec/hashie/extensions/indifferent_access_spec.rb
index 0aec787..27585f1 100644
--- a/spec/hashie/extensions/indifferent_access_spec.rb
+++ b/spec/hashie/extensions/indifferent_access_spec.rb
@@ -357,6 +357,18 @@ describe Hashie::Extensions::IndifferentAccess do
end
end
end
+
+ with_minimum_ruby('3.0.0') do
+ describe '#except' do
+ let(:h) { subject.build(foo: 'bar', baz: 'qux') }
+
+ it 'indifferently excepts keys from the hash' do
+ sliced_h = { 'baz' => 'qux' }
+ expect(h.except('foo')).to eq sliced_h
+ expect(h.except(:foo)).to eq sliced_h
+ end
+ end
+ end
end
describe 'with merge initializer' do