Skip to content

Commit

Permalink
Add a couple more checks in the tests for double commits.
Browse files Browse the repository at this point in the history
Just ensure that a `commit` really does stick with both new and edited
zip files.
  • Loading branch information
hainesr committed Jun 25, 2022
1 parent 14ff11b commit 708b7f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/file_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,11 @@ def test_double_commit(filename = 'test/data/generated/double_commit_test.zip')
zf = ::Zip::File.open(filename, create: true)
zf.add('test1.txt', 'test/data/generated/test_double_commit1.txt')
zf.commit
refute(zf.commit_required?)
zf.add('test2.txt', 'test/data/generated/test_double_commit2.txt')
assert(zf.commit_required?)
zf.commit
refute(zf.commit_required?)
zf.close
zf2 = ::Zip::File.open(filename)
refute_nil(zf2.entries.detect { |e| e.name == 'test1.txt' })
Expand Down

0 comments on commit 708b7f5

Please sign in to comment.