Add test case based on #146

This commit is contained in:
John Lees-Miller 2019-09-05 19:00:34 +01:00
parent 7fbaf1e6c0
commit eeef5073d5
1 changed files with 9 additions and 0 deletions

View File

@ -131,6 +131,15 @@ class ZipFileTest < MiniTest::Test
f.close
end
def test_open_buffer_with_io_and_block
File.open('test/data/rubycode.zip') do |io|
io.set_encoding(Encoding::BINARY) # not strictly required but can be set
Zip::File.open_buffer(io) do |zip_io|
# left empty on purpose
end
end
end
def test_open_buffer_without_block
string_io = StringIO.new File.read('test/data/rubycode.zip')
zf = ::Zip::File.open_buffer string_io