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.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 417a53b..0ea3e4f 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -504,6 +504,14 @@ class TestStringIO < Test::Unit::TestCase
assert_raise(RuntimeError, bug) {s.reopen("")}
end
+ def test_frozen_string
+ s = StringIO.new("".freeze)
+ bug = '[ruby-core:48530]'
+ assert_raise(IOError, bug) {s.write("foo")}
+ assert_raise(IOError, bug) {s.ungetc("a")}
+ assert_raise(IOError, bug) {s.ungetbyte("a")}
+ end
+
def test_readlines_limit_0
assert_raise(ArgumentError, "[ruby-dev:43392]") { StringIO.new.readlines(0) }
end