From 1ae2ac92d2afc114de6f595d3dfdfc4f228c7acc Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 7 Sep 2004 07:03:51 +0000 Subject: [PATCH] test_ungetc_paragraph: restore $/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/zlib/test_zlib.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 5a646cf8de..071cda065b 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -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