aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-11-11 19:39:21 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-11 19:39:21 +0100
commitf912a359aaaffa04fedb2ffd5730284d629b481a (patch)
treeee0163b662d378ba9dfe327cbbe17f3cde07790c /activesupport/test/core_ext
parentde2933e1a062f0752512eb0ec60f7217f4890f8c (diff)
parentcc135e3b6df1785852de2470b4b93559c88c891e (diff)
downloadrails-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.rb15
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)