diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 12fdade..213ad15 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -209,19 +209,6 @@ Style/SafeNavigation: - 'test/filesystem/file_stat_test.rb' - 'test/test_helper.rb' -# Offense count: 8 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: only_raise, only_fail, semantic -Style/SignalException: - Exclude: - - 'test/central_directory_entry_test.rb' - - 'test/central_directory_test.rb' - - 'test/filesystem/file_nonmutating_test.rb' - - 'test/ioextras/abstract_input_stream_test.rb' - - 'test/local_entry_test.rb' - - 'test/test_helper.rb' - # Offense count: 30 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. diff --git a/test/central_directory_entry_test.rb b/test/central_directory_entry_test.rb index fa0d806..c060a4d 100644 --- a/test/central_directory_entry_test.rb +++ b/test/central_directory_entry_test.rb @@ -63,7 +63,7 @@ class ZipCentralDirectoryEntryTest < MiniTest::Test fragment.extend(IOizeString) entry = ::Zip::Entry.new entry.read_c_dir_entry(fragment) - fail 'ZipError expected' + raise 'ZipError expected' rescue ::Zip::Error end end diff --git a/test/central_directory_test.rb b/test/central_directory_test.rb index 26be642..28e12f4 100644 --- a/test/central_directory_test.rb +++ b/test/central_directory_test.rb @@ -22,7 +22,7 @@ class ZipCentralDirectoryTest < MiniTest::Test cdir = ::Zip::CentralDirectory.new cdir.read_from_stream(zipFile) end - fail 'ZipError expected!' + raise 'ZipError expected!' rescue ::Zip::Error end @@ -33,7 +33,7 @@ class ZipCentralDirectoryTest < MiniTest::Test fragment.extend(IOizeString) entry = ::Zip::CentralDirectory.new entry.read_from_stream(fragment) - fail 'ZipError expected' + raise 'ZipError expected' rescue ::Zip::Error end diff --git a/test/filesystem/file_nonmutating_test.rb b/test/filesystem/file_nonmutating_test.rb index af575fa..73161cf 100644 --- a/test/filesystem/file_nonmutating_test.rb +++ b/test/filesystem/file_nonmutating_test.rb @@ -80,7 +80,7 @@ class ZipFsFileNonmutatingTest < MiniTest::Test end begin is = @zip_file.file.new('file1') do - fail 'should not call block' + raise 'should not call block' end ensure is.close if is diff --git a/test/ioextras/abstract_input_stream_test.rb b/test/ioextras/abstract_input_stream_test.rb index 3ae005d..46925a8 100644 --- a/test/ioextras/abstract_input_stream_test.rb +++ b/test/ioextras/abstract_input_stream_test.rb @@ -95,7 +95,7 @@ class AbstractInputStreamTest < MiniTest::Test test_gets begin @io.readline - fail 'EOFError expected' + raise 'EOFError expected' rescue EOFError end end diff --git a/test/local_entry_test.rb b/test/local_entry_test.rb index 666a63a..b02deb6 100644 --- a/test/local_entry_test.rb +++ b/test/local_entry_test.rb @@ -46,7 +46,7 @@ class ZipLocalEntryTest < MiniTest::Test zipFragment.extend(IOizeString).reset entry = ::Zip::Entry.new entry.read_local_entry(zipFragment) - fail 'ZipError expected' + raise 'ZipError expected' rescue ::Zip::Error end diff --git a/test/test_helper.rb b/test/test_helper.rb index ab52bad..a8b719f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -95,7 +95,7 @@ module AssertEntry if (expected && actual) && (expected.length > 400 || actual.length > 400) zipEntryFilename = entryName + '.zipEntry' File.open(zipEntryFilename, 'wb') { |entryfile| entryfile << actual } - fail("File '#{filename}' is different from '#{zipEntryFilename}'") + raise("File '#{filename}' is different from '#{zipEntryFilename}'") else assert_equal(expected, actual) end @@ -111,7 +111,7 @@ module AssertEntry if fileContents.length > 400 || aString.length > 400 stringFile = filename + '.other' File.open(stringFile, 'wb') { |f| f << aString } - fail("File '#{filename}' is different from contents of string stored in '#{stringFile}'") + raise("File '#{filename}' is different from contents of string stored in '#{stringFile}'") else assert_equal(fileContents, aString) end