mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Load list of rules dynamically
This commit is contained in:
parent
1822b2b0a2
commit
dcc0be892a
4 changed files with 12 additions and 16 deletions
|
@ -1,12 +1,6 @@
|
|||
require "../../spec/spec_helper"
|
||||
|
||||
module Ameba
|
||||
describe RULES do
|
||||
it "contains available rules" do
|
||||
Ameba::RULES.empty?.should be_false
|
||||
end
|
||||
end
|
||||
|
||||
describe Rule do
|
||||
describe "#catch" do
|
||||
it "accepts and returns source" do
|
||||
|
@ -20,5 +14,11 @@ module Ameba
|
|||
DummyRule.new.name.should eq "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
|
||||
|
|
|
@ -4,4 +4,4 @@ require "../src/ameba"
|
|||
struct DummyRule < Ameba::Rule
|
||||
def test(source)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue