summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/stringio/test_stringio.rb')
-rw-r--r--test/stringio/test_stringio.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index f5169f641a..89da34e4ec 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -722,9 +722,10 @@ class TestStringIO < Test::Unit::TestCase
s = StringIO.new
s.freeze
bug = '[ruby-core:33648]'
- assert_raise(FrozenError, bug) {s.puts("foo")}
- assert_raise(FrozenError, bug) {s.string = "foo"}
- assert_raise(FrozenError, bug) {s.reopen("")}
+ exception_class = defined?(FrozenError) ? FrozenError : RuntimeError
+ assert_raise(exception_class, bug) {s.puts("foo")}
+ assert_raise(exception_class, bug) {s.string = "foo"}
+ assert_raise(exception_class, bug) {s.reopen("")}
end
def test_frozen_string