Update tests to use the minitest 5.x API.
MiniTest::Unit::TestCase -> MiniTest::Test MiniTest::Unit.after_tests -> MiniTest.after_run
This commit is contained in:
parent
982b528711
commit
9785b66a43
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class BasicZipFileTest < MiniTest::Unit::TestCase
|
||||
class BasicZipFileTest < MiniTest::Test
|
||||
include AssertEntry
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipCentralDirectoryEntryTest < MiniTest::Unit::TestCase
|
||||
class ZipCentralDirectoryEntryTest < MiniTest::Test
|
||||
|
||||
def test_read_from_stream
|
||||
File.open("test/data/testDirectory.bin", "rb") {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipCentralDirectoryTest < MiniTest::Unit::TestCase
|
||||
class ZipCentralDirectoryTest < MiniTest::Test
|
||||
|
||||
def test_read_from_stream
|
||||
::File.open(TestZipFile::TEST_ZIP2.zip_name, "rb") {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class DeflaterTest < MiniTest::Unit::TestCase
|
||||
class DeflaterTest < MiniTest::Test
|
||||
include CrcTest
|
||||
|
||||
def test_outputOperator
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipEntrySetTest < MiniTest::Unit::TestCase
|
||||
class ZipEntrySetTest < MiniTest::Test
|
||||
ZIP_ENTRIES = [
|
||||
::Zip::Entry.new("zipfile.zip", "name1", "comment1"),
|
||||
::Zip::Entry.new("zipfile.zip", "name3", "comment1"),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipEntryTest < MiniTest::Unit::TestCase
|
||||
class ZipEntryTest < MiniTest::Test
|
||||
TEST_ZIPFILE = "someZipFile.zip"
|
||||
TEST_COMMENT = "a comment"
|
||||
TEST_COMPRESSED_SIZE = 1234
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# encoding: utf-8
|
||||
require 'test_helper'
|
||||
|
||||
class ErrorsTest < MiniTest::Unit::TestCase
|
||||
class ErrorsTest < MiniTest::Test
|
||||
|
||||
def test_rescue_legacy_zip_error
|
||||
raise ::Zip::Error
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipExtraFieldTest < MiniTest::Unit::TestCase
|
||||
class ZipExtraFieldTest < MiniTest::Test
|
||||
def test_new
|
||||
extra_pure = ::Zip::ExtraField.new("")
|
||||
extra_withstr = ::Zip::ExtraField.new("foo")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipFileExtractDirectoryTest < MiniTest::Unit::TestCase
|
||||
class ZipFileExtractDirectoryTest < MiniTest::Test
|
||||
include CommonZipFileFixture
|
||||
TEST_OUT_NAME = "emptyOutDir"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipFileExtractTest < MiniTest::Unit::TestCase
|
||||
class ZipFileExtractTest < MiniTest::Test
|
||||
include CommonZipFileFixture
|
||||
EXTRACTED_FILENAME = "extEntry"
|
||||
ENTRY_TO_EXTRACT, *REMAINING_ENTRIES = TEST_ZIP.entry_names.reverse
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipFileSplitTest < MiniTest::Unit::TestCase
|
||||
class ZipFileSplitTest < MiniTest::Test
|
||||
TEST_ZIP = TestZipFile::TEST_ZIP2.clone
|
||||
TEST_ZIP.zip_name = "large_zip_file.zip"
|
||||
EXTRACTED_FILENAME = "test/data/generated/extEntry"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
|
||||
class ZipFileTest < MiniTest::Unit::TestCase
|
||||
class ZipFileTest < MiniTest::Test
|
||||
include CommonZipFileFixture
|
||||
|
||||
def teardown
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/filesystem'
|
||||
|
||||
class ZipFsDirIteratorTest < MiniTest::Unit::TestCase
|
||||
class ZipFsDirIteratorTest < MiniTest::Test
|
||||
|
||||
FILENAME_ARRAY = [ "f1", "f2", "f3", "f4", "f5", "f6" ]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/filesystem'
|
||||
|
||||
class ZipFsDirectoryTest < MiniTest::Unit::TestCase
|
||||
class ZipFsDirectoryTest < MiniTest::Test
|
||||
TEST_ZIP = "test/data/generated/zipWithDirs_copy.zip"
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/filesystem'
|
||||
|
||||
class ZipFsFileMutatingTest < MiniTest::Unit::TestCase
|
||||
class ZipFsFileMutatingTest < MiniTest::Test
|
||||
TEST_ZIP = "test/data/generated/zipWithDirs_copy.zip"
|
||||
def setup
|
||||
FileUtils.cp("test/data/zipWithDirs.zip", TEST_ZIP)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/filesystem'
|
||||
|
||||
class ZipFsFileNonmutatingTest < MiniTest::Unit::TestCase
|
||||
class ZipFsFileNonmutatingTest < MiniTest::Test
|
||||
def setup
|
||||
@zipsha = Digest::SHA1.file("test/data/zipWithDirs.zip")
|
||||
@zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/filesystem'
|
||||
|
||||
class ZipFsFileStatTest < MiniTest::Unit::TestCase
|
||||
class ZipFsFileStatTest < MiniTest::Test
|
||||
|
||||
def setup
|
||||
@zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test_helper'
|
||||
class InflaterTest < MiniTest::Unit::TestCase
|
||||
class InflaterTest < MiniTest::Test
|
||||
include DecompressorTests
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipInputStreamTest < MiniTest::Unit::TestCase
|
||||
class ZipInputStreamTest < MiniTest::Test
|
||||
include AssertEntry
|
||||
|
||||
def test_new
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/ioextras'
|
||||
|
||||
class AbstractInputStreamTest < MiniTest::Unit::TestCase
|
||||
class AbstractInputStreamTest < MiniTest::Test
|
||||
# AbstractInputStream subclass that provides a read method
|
||||
|
||||
TEST_LINES = ["Hello world#{$/}",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/ioextras'
|
||||
|
||||
class AbstractOutputStreamTest < MiniTest::Unit::TestCase
|
||||
class AbstractOutputStreamTest < MiniTest::Test
|
||||
class TestOutputStream
|
||||
include ::Zip::IOExtras::AbstractOutputStream
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
require 'zip/ioextras'
|
||||
|
||||
class FakeIOTest < MiniTest::Unit::TestCase
|
||||
class FakeIOTest < MiniTest::Test
|
||||
class FakeIOUsingClass
|
||||
include ::Zip::IOExtras::FakeIO
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipLocalEntryTest < MiniTest::Unit::TestCase
|
||||
class ZipLocalEntryTest < MiniTest::Test
|
||||
|
||||
def teardown
|
||||
::Zip.write_zip64_support = false
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipOutputStreamTest < MiniTest::Unit::TestCase
|
||||
class ZipOutputStreamTest < MiniTest::Test
|
||||
include AssertEntry
|
||||
|
||||
TEST_ZIP = TestZipFile::TEST_ZIP2.clone
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class PassThruCompressorTest < MiniTest::Unit::TestCase
|
||||
class PassThruCompressorTest < MiniTest::Test
|
||||
include CrcTest
|
||||
|
||||
def test_size
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'test_helper'
|
||||
class PassThruDecompressorTest < MiniTest::Unit::TestCase
|
||||
class PassThruDecompressorTest < MiniTest::Test
|
||||
include DecompressorTests
|
||||
|
||||
def setup
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ZipSettingsTest < MiniTest::Unit::TestCase
|
||||
class ZipSettingsTest < MiniTest::Test
|
||||
# TODO Refactor out into common test module
|
||||
include CommonZipFileFixture
|
||||
TEST_OUT_NAME = "emptyOutDir"
|
||||
|
|
|
@ -9,7 +9,7 @@ require 'gentestfiles'
|
|||
TestFiles.create_test_files
|
||||
TestZipFile.create_test_zips
|
||||
|
||||
::MiniTest::Unit.after_tests do
|
||||
::MiniTest.after_run do
|
||||
FileUtils.rm_rf('test/data/generated')
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'test_helper'
|
||||
|
||||
class ZipUnicodeFileNamesAndComments < MiniTest::Unit::TestCase
|
||||
class ZipUnicodeFileNamesAndComments < MiniTest::Test
|
||||
|
||||
FILENAME = File.join(File.dirname(__FILE__), "test1.zip")
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ if ENV['FULL_ZIP64_TEST']
|
|||
# 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::Unit::TestCase
|
||||
class Zip64FullTest < MiniTest::Test
|
||||
def prepareTestFile(test_filename)
|
||||
::File.delete(test_filename) if ::File.exist?(test_filename)
|
||||
return test_filename
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class Zip64SupportTest < MiniTest::Unit::TestCase
|
||||
class Zip64SupportTest < MiniTest::Test
|
||||
TEST_FILE = File.join(File.dirname(__FILE__), 'data', 'zip64-sample.zip')
|
||||
|
||||
def test_open_zip64_file
|
||||
|
|
Loading…
Reference in New Issue