summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:34:45 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-16 12:34:45 +0000
commite94bc257290a94607cfe1ca98cfbd46d39056908 (patch)
treee2fc62d33b18eed7de99ab8e1ea1781ee3713191 /test
parentb5d29771b941d490539cffa9645927c301e98afe (diff)
merges r30467 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@30565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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