shard-ameba/spec/ameba/rule_spec.cr

25 lines
520 B
Crystal
Raw Normal View History

2017-10-30 20:00:01 +00:00
require "../../spec/spec_helper"
module Ameba
describe Rule do
describe "#catch" do
it "accepts and returns source" do
s = Source.new "", ""
DummyRule.new.catch(s).should eq s
end
end
describe "#name" do
it "returns name of the rule" do
2017-11-01 20:05:41 +00:00
DummyRule.new.name.should eq "Ameba::DummyRule"
2017-10-30 20:00:01 +00:00
end
end
2017-11-01 10:49:03 +00:00
describe ".rules" do
it "returns a list of all defined rules" do
Rule.rules.includes?(DummyRule).should be_true
end
end
2017-10-30 20:00:01 +00:00
end
end