diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 00:46:34 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 00:46:34 +0000 |
commit | b57915eddc91ce0369ae8bcf82d8c4364f42ea05 (patch) | |
tree | c5296c8fd95c9ee041fe66455eb0744c3212b5c5 /test/stringio | |
parent | 0b31ce0047513d1eb8f9902286215025a3742bf5 (diff) |
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 <code@jeremyevans.net>
Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r-- | test/stringio/test_stringio.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index f97ac877fc..f5169f641a 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -722,9 +722,9 @@ class TestStringIO < Test::Unit::TestCase s = StringIO.new s.freeze bug = '[ruby-core:33648]' - assert_raise(RuntimeError, bug) {s.puts("foo")} - assert_raise(RuntimeError, bug) {s.string = "foo"} - assert_raise(RuntimeError, bug) {s.reopen("")} + assert_raise(FrozenError, bug) {s.puts("foo")} + assert_raise(FrozenError, bug) {s.string = "foo"} + assert_raise(FrozenError, bug) {s.reopen("")} end def test_frozen_string |