diff options
author | Bobby McDonald <BobbyMcWho@users.noreply.github.com> | 2020-01-14 08:50:43 -0500 |
---|---|---|
committer | Daniel Doubrovkine (dB.) @dblockdotorg <dblock@dblock.org> | 2020-01-14 08:50:43 -0500 |
commit | 25fe2f747ee06e563808e08493ec7a471cc82b26 (patch) | |
tree | 131c87eb22d54097a58d6011e1a8c5669d7c0f51 /spec/hashie/extensions/deep_find_spec.rb | |
parent | d2071d82a2ceb2513bc0ff9c827ab3bc2a80b072 (diff) | |
download | hashie-25fe2f747ee06e563808e08493ec7a471cc82b26.tar.gz |
Fix except use in Mash#load (#508)
Diffstat (limited to 'spec/hashie/extensions/deep_find_spec.rb')
-rw-r--r-- | spec/hashie/extensions/deep_find_spec.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/spec/hashie/extensions/deep_find_spec.rb b/spec/hashie/extensions/deep_find_spec.rb index cd13d7f..fddb9d1 100644 --- a/spec/hashie/extensions/deep_find_spec.rb +++ b/spec/hashie/extensions/deep_find_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'active_support/core_ext/hash/indifferent_access' describe Hashie::Extensions::DeepFind do subject { Class.new(Hash) { include Hashie::Extensions::DeepFind } } @@ -71,41 +70,6 @@ describe Hashie::Extensions::DeepFind do end end - context 'on an ActiveSupport::HashWithIndifferentAccess' do - subject(:instance) { hash.with_indifferent_access.extend(Hashie::Extensions::DeepFind) } - - describe '#deep_find' do - it 'indifferently detects a value from a nested hash' do - expect(instance.deep_find(:address)).to eq('123 Library St.') - expect(instance.deep_find('address')).to eq('123 Library St.') - end - - it 'indifferently detects a value from a nested array' do - expect(instance.deep_find(:title)).to eq('Call of the Wild') - expect(instance.deep_find('title')).to eq('Call of the Wild') - end - - it 'indifferently returns nil if it does not find a match' do - expect(instance.deep_find(:wahoo)).to be_nil - expect(instance.deep_find('wahoo')).to be_nil - end - end - - describe '#deep_find_all' do - it 'indifferently detects all values from a nested hash' do - expect(instance.deep_find_all(:title)) - .to eq(['Call of the Wild', 'Moby Dick', 'Main Library']) - expect(instance.deep_find_all('title')) - .to eq(['Call of the Wild', 'Moby Dick', 'Main Library']) - end - - it 'indifferently returns nil if it does not find any matches' do - expect(instance.deep_find_all(:wahoo)).to be_nil - expect(instance.deep_find_all('wahoo')).to be_nil - end - end - end - context 'on a Hash including Hashie::Extensions::IndifferentAccess' do let(:klass) { Class.new(Hash) { include Hashie::Extensions::IndifferentAccess } } subject(:instance) { klass[hash.dup].extend(Hashie::Extensions::DeepFind) } |