mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
Open gzip file in binary mode
This commit is contained in:
parent
583f364f71
commit
d05a268adc
1 changed files with 2 additions and 2 deletions
|
@ -516,14 +516,14 @@ if defined? Zlib
|
|||
gz.close
|
||||
|
||||
results = []
|
||||
t = File.open(t.path)
|
||||
t = File.open(t.path, 'rb')
|
||||
Zlib::GzipReader.zcat(t) do |str|
|
||||
results << str
|
||||
end
|
||||
assert_equal(["foo", "bar"], results)
|
||||
t.close
|
||||
|
||||
t = File.open(t.path)
|
||||
t = File.open(t.path, 'rb')
|
||||
assert_equal("foobar", Zlib::GzipReader.zcat(t))
|
||||
t.close
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue