Fix Style/SignalException cop.
This commit is contained in:
parent
2f993221c0
commit
2cbdbf110b
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -95,7 +95,7 @@ class AbstractInputStreamTest < MiniTest::Test
|
|||
test_gets
|
||||
begin
|
||||
@io.readline
|
||||
fail 'EOFError expected'
|
||||
raise 'EOFError expected'
|
||||
rescue EOFError
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue