aboutsummaryrefslogtreecommitdiffstats
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:14:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:14:43 +0000
commitd8d9bac5c8b071135e50ad3f21c8a9b6a9c06e54 (patch)
treeb6b957bc5a752f891d43881e303ec395d639f3db /test/stringio
parent8cc0ee4a967af26feb0f1d723c5178cafd434ce8 (diff)
downloadruby-d8d9bac5c8b071135e50ad3f21c8a9b6a9c06e54.tar.gz
* ext/stringio/stringio.c (get_strio, strio_set_string)
(strio_reopen): check if frozen. [ruby-core:33648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index b7327adced..78718a2d86 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -471,4 +471,13 @@ class TestStringIO < Test::Unit::TestCase
expected_pos += 1
end
end
+
+ def test_frozen
+ 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("")}
+ end
end