Skip to content

Commit

Permalink
Test extra cases for redundant cop enable directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Eres committed Jun 13, 2021
1 parent 0599621 commit b7d75ac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/rubocop/cop/lint/redundant_cop_enable_directive_spec.rb
Expand Up @@ -325,5 +325,22 @@
# rubocop:enable Layout
RUBY
end

it 'registers offense and corrects redundant enabling of department of same cop' do
expect_offense(<<~RUBY)
# rubocop:disable Layout/LineLength
fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo = barrrrrrrrrrrrrrrrrrrrrrrrrr
# rubocop:enable Layout
^^^^^^ Unnecessary enabling of Layout.
some_code
RUBY

expect_correction(<<~RUBY)
# rubocop:disable Layout/LineLength
fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo = barrrrrrrrrrrrrrrrrrrrrrrrrr
some_code
RUBY
end
end
end

0 comments on commit b7d75ac

Please sign in to comment.