Skip to content

Commit

Permalink
Add test case based on #146
Browse files Browse the repository at this point in the history
  • Loading branch information
jdleesmiller committed Sep 5, 2019
1 parent 7fbaf1e commit eeef507
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/file_test.rb
Expand Up @@ -131,6 +131,15 @@ def test_close_buffer_with_io
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
Expand Down

0 comments on commit eeef507

Please sign in to comment.