shard-ameba/spec/ameba/rule_spec.cr
Vitalii Elenhaupt c9f229c3f1
Custom matcher
2017-11-01 22:05:41 +02:00

25 lines
520 B
Crystal

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
DummyRule.new.name.should eq "Ameba::DummyRule"
end
end
describe ".rules" do
it "returns a list of all defined rules" do
Rule.rules.includes?(DummyRule).should be_true
end
end
end
end