diff options
author | Andrea Campi <andrea.campi@zephirworks.com> | 2010-10-09 19:28:43 +0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-10 14:06:44 -0200 |
commit | d80afed620dde5b9356c883ae187db2332d4c18e (patch) | |
tree | e632db797a0512e626f5e1ef3399ddf9620f1b30 /activesupport/test | |
parent | 621df2a1ec01b77f7b052b3571f3c696f0443fea (diff) | |
download | rails-d80afed620dde5b9356c883ae187db2332d4c18e.tar.gz rails-d80afed620dde5b9356c883ae187db2332d4c18e.tar.bz2 rails-d80afed620dde5b9356c883ae187db2332d4c18e.zip |
Override #store to be consistent with #[].
[#5775 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 0f35eb9e78..545fed2684 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -316,6 +316,16 @@ class HashExtTest < Test::Unit::TestCase assert_equal expected, hash_1 end + def test_store_on_indifferent_access + hash = HashWithIndifferentAccess.new + hash.store(:test1, 1) + hash.store('test1', 11) + hash[:test2] = 2 + hash['test2'] = 22 + expected = { "test1" => 11, "test2" => 22 } + assert_equal expected, hash + end + def test_reverse_merge defaults = { :a => "x", :b => "y", :c => 10 }.freeze options = { :a => 1, :b => 2 } |