diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-03-23 23:08:36 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-03-23 23:09:29 +0300 |
commit | 2ee28b2bf8414cad3655dbe685ff0d27051395cd (patch) | |
tree | 42406d06accb8448bd8696918fe39c75f885e950 /activesupport/test | |
parent | ea482d366addd86ea3a5255e6e764733b9a17fa8 (diff) | |
download | rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.tar.gz rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.tar.bz2 rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.zip |
fix HashWithIndifferentAccess.[] method
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 4544edf0dd..80b3c16328 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -388,6 +388,15 @@ class HashExtTest < ActiveSupport::TestCase assert_equal expected, hash end + def test_constructor_on_indifferent_access + hash = HashWithIndifferentAccess[:foo, 1] + assert_equal 1, hash[:foo] + assert_equal 1, hash['foo'] + hash[:foo] = 3 + assert_equal 3, hash[:foo] + assert_equal 3, hash['foo'] + end + def test_reverse_merge defaults = { :a => "x", :b => "y", :c => 10 }.freeze options = { :a => 1, :b => 2 } |