shard-ameba/spec/ameba/rule/base_spec.cr

33 lines
681 B
Crystal
Raw Permalink Normal View History

2017-12-24 21:32:14 +00:00
require "../../spec_helper"
2017-10-30 20:00:01 +00:00
module Ameba
2017-11-07 21:50:25 +00:00
describe Rule::Base do
2017-10-30 20:00:01 +00:00
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"
2017-10-30 20:00:01 +00:00
end
end
2018-06-18 07:25:06 +00:00
describe "#group" do
it "returns a group rule belongs to" do
DummyRule.new.group.should eq "Ameba"
end
end
2017-11-07 21:50:25 +00:00
end
2017-11-01 10:49:03 +00:00
2017-11-07 21:50:25 +00:00
describe Rule do
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