test/zip64_full_test.rb in rubyzip-1.1.7 vs test/zip64_full_test.rb in rubyzip-1.2.0
- old
+ new
@@ -2,36 +2,36 @@
require 'minitest/autorun'
require 'minitest/unit'
require 'fileutils'
require 'zip'
-# test zip64 support for real, by actually exceeding the 32-bit size/offset limits
-# this test does not, of course, run with the normal unit tests! ;)
+ # test zip64 support for real, by actually exceeding the 32-bit size/offset limits
+ # this test does not, of course, run with the normal unit tests! ;)
class Zip64FullTest < MiniTest::Test
def teardown
::Zip.reset!
end
- def prepareTestFile(test_filename)
+ def prepare_test_file(test_filename)
::File.delete(test_filename) if ::File.exist?(test_filename)
- return test_filename
+ test_filename
end
- def test_largeZipFile
+ def test_large_zip_file
::Zip.write_zip64_support = true
first_text = 'starting out small'
last_text = 'this tests files starting after 4GB in the archive'
- test_filename = prepareTestFile('huge.zip')
+ test_filename = prepare_test_file('huge.zip')
::Zip::OutputStream.open(test_filename) do |io|
io.put_next_entry('first_file.txt')
io.write(first_text)
# write just over 4GB (stored, so the zip file exceeds 4GB)
- buf = 'blah' * 16384
+ buf = 'blah' * 16_384
io.put_next_entry('huge_file', nil, nil, ::Zip::Entry::STORED)
- 65537.times { io.write(buf) }
+ 65_537.times { io.write(buf) }
io.put_next_entry('last_file.txt')
io.write(last_text)
end
@@ -42,12 +42,10 @@
end
# note: if this fails, be sure you have UnZip version 6.0 or newer
# as this is the first version to support zip64 extensions
# but some OSes (*cough* OSX) still bundle a 5.xx release
- assert system("unzip -t #{test_filename}"), "third-party zip validation failed"
+ assert system("unzip -t #{test_filename}"), 'third-party zip validation failed'
end
-
end
end
-