mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_ungetc_paragraph: restore $/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
08907d87e0
commit
1ae2ac92d2
1 changed files with 12 additions and 7 deletions
|
@ -35,13 +35,18 @@ if defined? Zlib
|
|||
w << "abc"
|
||||
w.close
|
||||
r = Zlib::GzipReader.new(StringIO.new(s))
|
||||
$/ = ""
|
||||
r.ungetc ?\n
|
||||
assert_equal("abc", r.gets)
|
||||
assert_nothing_raised {
|
||||
r.read
|
||||
r.close
|
||||
}
|
||||
begin
|
||||
old_rs = $/
|
||||
$/ = ""
|
||||
r.ungetc ?\n
|
||||
assert_equal("abc", r.gets)
|
||||
assert_nothing_raised {
|
||||
r.read
|
||||
r.close
|
||||
}
|
||||
ensure
|
||||
$/ = old_rs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue