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

wrong commit; sorry

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-06-19 17:26:20 +00:00
parent ed536836db
commit 281d835f89
8 changed files with 124 additions and 284 deletions

View file

@ -40,4 +40,17 @@ class TestStringIO < Test::Unit::TestCase
end
assert_equal("hacker\nother ruby\n", stringio.string)
end
def test_reopen
f = StringIO.new("foo\nbar\nbaz\n")
assert_equal("foo\n", f.gets)
f.reopen("qux\nquux\nquuux\n")
assert_equal("qux\n", f.gets)
f2 = StringIO.new("")
f2.reopen(f)
assert_equal("quux\n", f2.gets)
ensure
f.close unless f.closed?
end
end