aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
authorAndrea Campi <andrea.campi@zephirworks.com>2010-10-09 19:28:43 +0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-10-10 14:06:44 -0200
commitd80afed620dde5b9356c883ae187db2332d4c18e (patch)
treee632db797a0512e626f5e1ef3399ddf9620f1b30 /activesupport/test/core_ext/hash_ext_test.rb
parent621df2a1ec01b77f7b052b3571f3c696f0443fea (diff)
downloadrails-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/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb10
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 }