Add rule's name to flycheck formatter

This commit is contained in:
Vitalii Elenhaupt 2018-01-31 13:30:59 +02:00
parent 69cff77970
commit 2382657e15
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 8 additions and 4 deletions

View file

@ -21,7 +21,9 @@ module Ameba::Formatter
s.error DummyRule.new, 1, 2, "message"
subject = flycheck
subject.source_finished s
subject.output.to_s.should eq "source.cr:1:2: E: message\n"
subject.output.to_s.should eq(
"source.cr:1:2: E: [#{DummyRule.name}] message\n"
)
end
it "properly reports multi-line message" do
@ -29,7 +31,9 @@ module Ameba::Formatter
s.error DummyRule.new, 1, 2, "multi\nline"
subject = flycheck
subject.source_finished s
subject.output.to_s.should eq "source.cr:1:2: E: multi line\n"
subject.output.to_s.should eq(
"source.cr:1:2: E: [#{DummyRule.name}] multi line\n"
)
end
it "reports nothing if location was not set" do