Fix TypeError: can't dup NilClass from EntrySet#dup

This commit is contained in:
Oleksandr Avoiants 2015-12-19 11:26:20 +02:00
parent 9dd0912fcb
commit 73bfa5955c
3 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module Zip
end
def <<(entry)
@entry_set[to_key(entry)] = entry
@entry_set[to_key(entry)] = entry if entry
end
alias push <<

BIN
test/data/test.xls Normal file

Binary file not shown.

View File

@ -546,6 +546,10 @@ class ZipFileTest < MiniTest::Test
assert_equal 13, entry_count
end
def test_open_xls_does_not_raise_type_error
::Zip::File.open('test/data/test.xls')
end
private
def assert_contains(zf, entryName, filename = entryName)