Test generated boolean rule property

This commit is contained in:
Sijawusz Pur Rahnama 2022-11-22 19:53:27 +01:00
parent 9f670c09b5
commit 60813e4899
3 changed files with 6 additions and 0 deletions

View file

@ -32,6 +32,10 @@ module Ameba::Rule
subject.description.should_not be_nil subject.description.should_not be_nil
end end
it "has a dummy? property" do
subject.dummy?.should be_true
end
it "has excluded property" do it "has excluded property" do
subject.excluded.should be_nil subject.excluded.should be_nil
end end

View file

@ -102,6 +102,7 @@ module Ameba
# Run `ameba --only Ameba/DummyRule` for details # Run `ameba --only Ameba/DummyRule` for details
Ameba/DummyRule: Ameba/DummyRule:
Description: Dummy rule that does nothing. Description: Dummy rule that does nothing.
Dummy: true
Excluded: Excluded:
- source1.cr - source1.cr
- source2.cr - source2.cr

View file

@ -7,6 +7,7 @@ module Ameba
class DummyRule < Rule::Base class DummyRule < Rule::Base
properties do properties do
description : String = "Dummy rule that does nothing." description : String = "Dummy rule that does nothing."
dummy true
end end
def test(source) def test(source)