summaryrefslogtreecommitdiff
path: root/test/zlib/test_zlib.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-07 07:03:51 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-07 07:03:51 +0000
commit1ae2ac92d2afc114de6f595d3dfdfc4f228c7acc (patch)
tree92cd9e98589979756e4b25ab17ea4954db1a35d0 /test/zlib/test_zlib.rb
parent08907d87e01ba0181b90603e27ec83cd9c285ad8 (diff)
downloadruby-1ae2ac92d2afc114de6f595d3dfdfc4f228c7acc.tar.gz
test_ungetc_paragraph: restore $/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib/test_zlib.rb')
-rw-r--r--test/zlib/test_zlib.rb19
1 files 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