Skip to content

Commit

Permalink
Fix confusing test in case_indentation_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
dvandersluis authored and mergify[bot] committed Sep 14, 2021
1 parent 6ef5b05 commit 9f20b87
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions spec/rubocop/cop/layout/case_indentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -818,20 +818,17 @@
end
end

context 'when `case` is preceded by something else than whitespace' do
context 'when `when` is on the same line as `case`' do
let(:cop_config) { {} }

it 'registers an offense and auto-corrects' do
it 'registers an offense but does not auto-correct' do
expect_offense(<<~RUBY)
case test when something
^^^^ Indent `when` as deep as `case`.
end
RUBY

expect_correction(<<~RUBY)
case test when something
end
RUBY
expect_no_corrections
end
end
end

0 comments on commit 9f20b87

Please sign in to comment.