Syntax rule running priorities

This commit is contained in:
Vitalii Elenhaupt 2018-01-25 11:50:11 +02:00 committed by V. Elenhaupt
parent c9db63bf34
commit 4c85ad7c75
8 changed files with 64 additions and 12 deletions

View file

@ -50,6 +50,21 @@ module Ameba
it "excludes source from this rule" do
create_todo.should contain "Excluded:\n - source.cr"
end
context "when invalid syntax" do
it "does not exclude Syntax rule" do
file = IO::Memory.new
formatter = Formatter::TODOFormatter.new IO::Memory.new, file
s = Source.new "def invalid_syntax"
s.error Rule::Syntax.new, s.location(1, 2), "message"
formatter.finished [s]
content = file.to_s
content.should_not contain "Syntax"
end
end
end
end
end