Fix Performance/StringInclude cop.
This commit is contained in:
parent
530afe5d0c
commit
ed21f9cf17
|
@ -63,13 +63,6 @@ Performance/RegexpMatch:
|
|||
- 'test/file_test.rb'
|
||||
- 'test/gentestfiles.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect.
|
||||
Performance/StringInclude:
|
||||
Exclude:
|
||||
- 'test/file_test.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
|
|
|
@ -699,14 +699,14 @@ class ZipFileTest < MiniTest::Test
|
|||
File.open(zname, 'rb') do |f|
|
||||
Zip::File.open_buffer(f) do |zipfile|
|
||||
zipfile.each do |entry|
|
||||
next unless entry.name =~ /README.md/
|
||||
next unless entry.name.include?('README.md')
|
||||
|
||||
data = zipfile.read(entry)
|
||||
end
|
||||
end
|
||||
end
|
||||
assert data
|
||||
assert data =~ /Simonov/
|
||||
assert data.include?('Simonov')
|
||||
end
|
||||
|
||||
def test_nonexistant_zip
|
||||
|
|
Loading…
Reference in New Issue