Skip to content

Commit

Permalink
Add a spec for config/default.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jun 3, 2023
1 parent 22883ae commit dbabb7d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@
end
end

it 'does not include unnecessary `SafeAutoCorrect: false`' do
cop_names.each do |cop_name|
next unless config.dig(cop_name, 'Safe') == false

safe_autocorrect = config.dig(cop_name, 'SafeAutoCorrect')

expect(safe_autocorrect).not_to(be(false), "`#{cop_name}` has unnecessary `SafeAutoCorrect: false` config.")
end
end

it 'is expected that all cops documented with `@safety` are `Safe: false` or `SafeAutoCorrect: false`' do
require 'yard'

Expand Down

0 comments on commit dbabb7d

Please sign in to comment.