From aa57e66fec3a131f5d246b8950a2c3286f858b78 Mon Sep 17 00:00:00 2001 From: Bradford Folkens Date: Thu, 12 Mar 2009 15:03:01 +0000 Subject: Ensure HWIA#reverse_merge! retrurns HWIA [#421 state:resolved] Signed-off-by: Pratik Naik --- activesupport/test/core_ext/hash_ext_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test/core_ext/hash_ext_test.rb') diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 80582cd9c9..482ae57830 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -174,6 +174,13 @@ class HashExtTest < Test::Unit::TestCase assert_equal 2, hash['b'] end + def test_indifferent_reverse_merging + hash = HashWithIndifferentAccess.new('some' => 'value', 'other' => 'value') + hash.reverse_merge!(:some => 'noclobber', :another => 'clobber') + assert_equal 'value', hash[:some] + assert_equal 'clobber', hash[:another] + end + def test_indifferent_deleting get_hash = proc{ { :a => 'foo' }.with_indifferent_access } hash = get_hash.call -- cgit v1.2.3