From b57915eddc91ce0369ae8bcf82d8c4364f42ea05 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 12 Dec 2017 00:46:34 +0000 Subject: Add FrozenError as a subclass of RuntimeError FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans Signed-off-by: Urabe Shyouhei git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_hash.rb') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 813afaeee0..ea19ba80a7 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1031,8 +1031,8 @@ class TestHash < Test::Unit::TestCase 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) } + assert_raise(FrozenError) { h2.replace(h1) } + assert_raise(FrozenError) { h2.replace(42) } end def test_size2 -- cgit v1.2.3