diff --git a/spec/project/default_config_spec.rb b/spec/project/default_config_spec.rb index e024addce..7b02deb72 100644 --- a/spec/project/default_config_spec.rb +++ b/spec/project/default_config_spec.rb @@ -81,4 +81,17 @@ def cop_configuration(config_key) expect(cop_configuration('Enabled')) .to all be(true).or(be(false)).or(eq('pending')) end + + it 'does not include unnecessary `SafeAutoCorrect: false`' do + cop_names.each do |cop_name| + next unless default_config.dig(cop_name, 'Safe') == false + + safe_autocorrect = default_config.dig(cop_name, 'SafeAutoCorrect') + + expect(safe_autocorrect).not_to( + be(false), + "`#{cop_name}` has unnecessary `SafeAutoCorrect: false` config." + ) + end + end end