diff options
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r-- | test/ruby/test_hash.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 5c9b08b917..6f703d947c 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -748,6 +748,13 @@ class TestHash < Test::Unit::TestCase h2 = {} h2.replace h1 assert_equal(:foo, h2[0]) + + assert_raise(ArgumentError) { h2.replace() } + assert_raise(TypeError) { h2.replace(1) } + h2.freeze + assert_raise(ArgumentError) { h2.replace() } + assert_raise(RuntimeError) { h2.replace(h1) } + assert_raise(RuntimeError) { h2.replace(42) } end def test_size2 |