diff options
-rw-r--r-- | test/zlib/test_zlib.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 5a646cf8d..071cda065 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 |