1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2011-01-05 20:14:43 +00:00
parent 8cc0ee4a96
commit d8d9bac5c8
3 changed files with 17 additions and 3 deletions

View file

@ -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