diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-07 07:03:51 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-07 07:03:51 +0000 |
commit | 8499115c077f0fb0007f119a0da5a2443deffbf3 (patch) | |
tree | 3b4b8258954c98cb945237cd58d6cc286c1086fd /test | |
parent | 732b0f5720277467e869f9b8c0c95af6f0787bb4 (diff) | |
download | ruby-8499115c077f0fb0007f119a0da5a2443deffbf3.tar.gz ruby-8499115c077f0fb0007f119a0da5a2443deffbf3.tar.xz ruby-8499115c077f0fb0007f119a0da5a2443deffbf3.zip |
test_ungetc_paragraph: restore $/.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 |