Skip to content

Commit

Permalink
Update tests to use the minitest 5.x API.
Browse files Browse the repository at this point in the history
MiniTest::Unit::TestCase -> MiniTest::Test
MiniTest::Unit.after_tests -> MiniTest.after_run
  • Loading branch information
hainesr committed Jul 15, 2014
1 parent f37f157 commit 3b25a4f
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion test/basic_zip_file_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class BasicZipFileTest < MiniTest::Unit::TestCase
class BasicZipFileTest < MiniTest::Test
include AssertEntry

def setup
Expand Down
2 changes: 1 addition & 1 deletion test/central_directory_entry_test.rb
Original file line number Diff line number Diff line change
@@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion test/central_directory_test.rb
Original file line number Diff line number Diff line change
@@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion test/deflater_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class DeflaterTest < MiniTest::Unit::TestCase
class DeflaterTest < MiniTest::Test
include CrcTest

def test_outputOperator
Expand Down
2 changes: 1 addition & 1 deletion test/entry_set_test.rb
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion test/entry_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/errors_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/extra_field_test.rb
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion test/file_extract_directory_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class ZipFileExtractDirectoryTest < MiniTest::Unit::TestCase
class ZipFileExtractDirectoryTest < MiniTest::Test
include CommonZipFileFixture
TEST_OUT_NAME = "emptyOutDir"

Expand Down
2 changes: 1 addition & 1 deletion test/file_extract_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/file_split_test.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/file_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test_helper'


class ZipFileTest < MiniTest::Unit::TestCase
class ZipFileTest < MiniTest::Test
include CommonZipFileFixture

def teardown
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/dir_iterator_test.rb
Original file line number Diff line number Diff line change
@@ -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" ]

Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/directory_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/file_mutating_test.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/file_nonmutating_test.rb
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/file_stat_test.rb
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion test/inflater_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'test_helper'
class InflaterTest < MiniTest::Unit::TestCase
class InflaterTest < MiniTest::Test
include DecompressorTests

def setup
Expand Down
2 changes: 1 addition & 1 deletion test/input_stream_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class ZipInputStreamTest < MiniTest::Unit::TestCase
class ZipInputStreamTest < MiniTest::Test
include AssertEntry

def test_new
Expand Down
2 changes: 1 addition & 1 deletion test/ioextras/abstract_input_stream_test.rb
Original file line number Diff line number Diff line change
@@ -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#{$/}",
Expand Down
2 changes: 1 addition & 1 deletion test/ioextras/abstract_output_stream_test.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/ioextras/fake_io_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/local_entry_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class ZipLocalEntryTest < MiniTest::Unit::TestCase
class ZipLocalEntryTest < MiniTest::Test

def teardown
::Zip.write_zip64_support = false
Expand Down
2 changes: 1 addition & 1 deletion test/output_stream_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class ZipOutputStreamTest < MiniTest::Unit::TestCase
class ZipOutputStreamTest < MiniTest::Test
include AssertEntry

TEST_ZIP = TestZipFile::TEST_ZIP2.clone
Expand Down
2 changes: 1 addition & 1 deletion test/pass_thru_compressor_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class PassThruCompressorTest < MiniTest::Unit::TestCase
class PassThruCompressorTest < MiniTest::Test
include CrcTest

def test_size
Expand Down
2 changes: 1 addition & 1 deletion test/pass_thru_decompressor_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'test_helper'
class PassThruDecompressorTest < MiniTest::Unit::TestCase
class PassThruDecompressorTest < MiniTest::Test
include DecompressorTests

def setup
Expand Down
2 changes: 1 addition & 1 deletion test/settings_test.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
TestFiles.create_test_files
TestZipFile.create_test_zips

::MiniTest::Unit.after_tests do
::MiniTest.after_run do
FileUtils.rm_rf('test/data/generated')
end

Expand Down
2 changes: 1 addition & 1 deletion test/unicode_file_names_and_comments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'test_helper'

class ZipUnicodeFileNamesAndComments < MiniTest::Unit::TestCase
class ZipUnicodeFileNamesAndComments < MiniTest::Test

FILENAME = File.join(File.dirname(__FILE__), "test1.zip")

Expand Down
2 changes: 1 addition & 1 deletion test/zip64_full_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 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
Expand Down
2 changes: 1 addition & 1 deletion test/zip64_support_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3b25a4f

Please sign in to comment.