Skip to content

Commit

Permalink
Suppress an offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
renawatson68 committed Nov 11, 2020
1 parent 1bfeed7 commit 64485e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/rubocop/cop/performance/io_readlines_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
end

it 'registers an offense when using `IO.readlines` followed by `#each` method' do
# Note: `each_line` in message, not `each_line.each`
# NOTE: `each_line` in message, not `each_line.each`
expect_offense(<<~RUBY)
IO.readlines('testfile').each { |l| puts l }
^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `each_line` instead of `readlines.each`.
Expand All @@ -43,7 +43,7 @@
end

it 'registers an offense and corrects when using `#readlines` on an instance followed by `#each` method' do
# Note: `each_line` in message, not `each_line.each`
# NOTE: `each_line` in message, not `each_line.each`
expect_offense(<<~RUBY)
file.readlines(10).each { |l| puts l }
^^^^^^^^^^^^^^^^^^ Use `each_line` instead of `readlines.each`.
Expand Down

0 comments on commit 64485e7

Please sign in to comment.