mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add inline directives parsing and disabling
This commit is contained in:
parent
55b66e7975
commit
9f85b16e09
9 changed files with 212 additions and 7 deletions
|
@ -36,6 +36,27 @@ module Ameba::Formatter
|
|||
subject.finished [Source.new ""]
|
||||
output.to_s.should contain "Finished in"
|
||||
end
|
||||
|
||||
context "when errors found" do
|
||||
it "writes each error" do
|
||||
s = Source.new("").tap do |s|
|
||||
s.error(DummyRule.new, 1, 1, "DummyRuleError")
|
||||
s.error(NamedRule.new, 1, 2, "NamedRuleError")
|
||||
end
|
||||
subject.finished [s]
|
||||
log = output.to_s
|
||||
log.should contain "1 inspected, 2 failures."
|
||||
log.should contain "DummyRuleError"
|
||||
log.should contain "NamedRuleError"
|
||||
end
|
||||
|
||||
it "does not write disabled errors" do
|
||||
s = Source.new ""
|
||||
s.error(DummyRule.new, 1, 1, "DummyRuleError", :disabled)
|
||||
subject.finished [s]
|
||||
output.to_s.should contain "1 inspected, 0 failures."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue