mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
30 lines
717 B
Crystal
30 lines
717 B
Crystal
require "../../spec_helper"
|
|
|
|
module Ameba
|
|
private def rule_presenter_each_rule(&)
|
|
with_presenter(Presenter::RulePresenter) do |presenter, io|
|
|
rules = Config.load.rules
|
|
rules.each do |rule|
|
|
presenter.run(rule)
|
|
|
|
output = io.to_s
|
|
output = Formatter::Util.deansify(output).to_s
|
|
|
|
yield rule, output, presenter
|
|
end
|
|
end
|
|
end
|
|
|
|
describe Presenter::RulePresenter do
|
|
it "outputs rule details" do
|
|
rule_presenter_each_rule do |rule, output|
|
|
output.should contain rule.name
|
|
output.should contain rule.severity.to_s
|
|
|
|
if description = rule.description
|
|
output.should contain description
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|