summaryrefslogtreecommitdiff
path: root/test/ruby/test_hash.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r--test/ruby/test_hash.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 34d58a0354..1806746ef2 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -91,6 +91,15 @@ class TestHash < Test::Unit::TestCase
$VERBOSE = @verbose
end
+ def test_bad_initialize_copy
+ h = Class.new(Hash) {
+ def initialize_copy(h)
+ super(Object.new)
+ end
+ }.new
+ assert_raises(TypeError) { h.dup }
+ end
+
def test_s_AREF
h = @cls["a" => 100, "b" => 200]
assert_equal(100, h['a'])