2014-04-11 06:32:17 +08:00
|
|
|
# encoding: utf-8
|
2017-06-29 10:57:12 +08:00
|
|
|
|
2014-04-11 06:32:17 +08:00
|
|
|
require 'test_helper'
|
|
|
|
|
2014-07-15 23:23:48 +08:00
|
|
|
class ErrorsTest < MiniTest::Test
|
2014-04-11 06:32:17 +08:00
|
|
|
def test_rescue_legacy_zip_error
|
|
|
|
raise ::Zip::Error
|
|
|
|
rescue ::Zip::ZipError
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_rescue_legacy_zip_entry_exists_error
|
|
|
|
raise ::Zip::EntryExistsError
|
|
|
|
rescue ::Zip::ZipEntryExistsError
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_rescue_legacy_zip_destination_file_exists_error
|
|
|
|
raise ::Zip::DestinationFileExistsError
|
|
|
|
rescue ::Zip::ZipDestinationFileExistsError
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_rescue_legacy_zip_compression_method_error
|
|
|
|
raise ::Zip::CompressionMethodError
|
|
|
|
rescue ::Zip::ZipCompressionMethodError
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_rescue_legacy_zip_entry_name_error
|
|
|
|
raise ::Zip::EntryNameError
|
|
|
|
rescue ::Zip::ZipEntryNameError
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_rescue_legacy_zip_internal_error
|
|
|
|
raise ::Zip::InternalError
|
|
|
|
rescue ::Zip::ZipInternalError
|
|
|
|
end
|
|
|
|
end
|