Skip to content

Commit cdd02a1

Browse files
Add a test to confirm that .rubocop.yml is used
1 parent 0b1893a commit cdd02a1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/cc/engine/rubocop_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ def method
4242
assert !includes_check?(output, "Lint/UselessAssignment")
4343
end
4444

45+
it "respects the default .rubocop.yml file" do
46+
create_source_file("foo.rb", <<-EORUBY)
47+
def method
48+
unused = "x" and "y"
49+
50+
return false
51+
end
52+
EORUBY
53+
54+
create_source_file(
55+
".rubocop.yml",
56+
"Lint/UselessAssignment:\n Enabled: false\n"
57+
)
58+
59+
output = run_engine
60+
61+
assert includes_check?(output, "Style/AndOr")
62+
assert !includes_check?(output, "Lint/UselessAssignment")
63+
end
64+
4565
it "reads a file with a #!.*ruby declaration at the top" do
4666
create_source_file("my_script", <<-EORUBY)
4767
#!/usr/bin/env ruby

0 commit comments

Comments
 (0)