diff options
author | José Valim <jose.valim@gmail.com> | 2010-11-11 19:39:21 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-11 19:39:21 +0100 |
commit | f912a359aaaffa04fedb2ffd5730284d629b481a (patch) | |
tree | ee0163b662d378ba9dfe327cbbe17f3cde07790c /activesupport/test/core_ext | |
parent | de2933e1a062f0752512eb0ec60f7217f4890f8c (diff) | |
parent | cc135e3b6df1785852de2470b4b93559c88c891e (diff) | |
download | rails-f912a359aaaffa04fedb2ffd5730284d629b481a.tar.gz rails-f912a359aaaffa04fedb2ffd5730284d629b481a.tar.bz2 rails-f912a359aaaffa04fedb2ffd5730284d629b481a.zip |
Merge remote branch 'drogus/plugin_new'
Conflicts:
railties/test/generators/app_generator_test.rb
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 03fbee93a2..d7b77e43bd 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -329,6 +329,21 @@ class HashExtTest < Test::Unit::TestCase assert_equal expected, hash_1 end + def test_deep_dup + hash = { :a => { :b => 'b' } } + dup = hash.deep_dup + dup[:a][:c] = 'c' + assert_equal nil, hash[:a][:c] + assert_equal 'c', dup[:a][:c] + end + + def test_deep_dup_initialize + zero_hash = Hash.new 0 + hash = { :a => zero_hash } + dup = hash.deep_dup + assert_equal 0, dup[:a][44] + end + def test_store_on_indifferent_access hash = HashWithIndifferentAccess.new hash.store(:test1, 1) |