Skip to content

Commit 53dbc7a

Browse files
committed
Add project_spec test to ensure that Safe: true is not given in a config, since it is redundant
Follow up to rubocop/rubocop#9323.
1 parent e0b4fce commit 53dbc7a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spec/project_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,21 @@
6666
raise errors.join("\n") unless errors.empty?
6767
end
6868

69-
it 'does not have nay duplication' do
69+
it 'does not have any duplication' do
7070
fname = File.expand_path('../config/default.yml', __dir__)
7171
content = File.read(fname)
7272
RuboCop::YAMLDuplicationChecker.check(content, fname) do |key1, key2|
7373
raise "#{fname} has duplication of #{key1.value} " \
7474
"on line #{key1.start_line} and line #{key2.start_line}"
7575
end
7676
end
77+
78+
it 'does not include `Safe: true`' do
79+
cop_names.each do |name|
80+
safe = config[name]['Safe']
81+
expect(safe).not_to eq(true), "`#{name}` has unnecessary `Safe: true` config."
82+
end
83+
end
7784
end
7885

7986
shared_examples 'has Changelog format' do

0 commit comments

Comments
 (0)