RSpec Results

 

 

Rools::Facts
should have a name
should have a value
should be printable
could have more than one value and contain an array of values
a fact could have a namespace
Rools
should have a logger
should cache
Assertions in Rules
a rule should be able to assert a new object or fact
Rule Errors
rule execution should fail when an exception is encountered while evaluating a condition
rule execution should fail when an exception is encountered while evaluating a consequence
Rools::Rule
should have a name that will be downcased
can have an optional priority
can have an optional parameter tag
a rule parameter tag can define one or more types
a rule parameter tage can define a Class type and a required method to respond to
but should fails if Class type is correct but does not respond to specified method
a rule parameter type has to be pre-defined or will generate a RuleCheckError
should capture the rule name in a RuleCheckError
can have optional conditions
should have one or more consequences
should fail if an invalid symbol is used
Extending Rules
should allow rule extension
should allow user extension
Empty RuleSet
should not contain any rules
should not contain any facts
responds to assert
can assert with one or more parameters
responds to evaluate
has null metrics
can accept new facts programmatically and delete all facts
can accept more than one fact of the same type, they get associated in the same fact type
can accept fact stements in a rule set
can load an xml file
should generate an RuleLoadingError if loading a bad xml file
can load an xml string
can load an rb file
should generate an RuleLoadingError if loading a bad ruby file
can load an rb rule string
can load a csv file
can be initialized with an .xml file
can be initialized with an .rb file
can be initialized with an .rules file, equivalent to .rb
can be initialized with a .csv file
or will generate an error for other extensions
can stop rule evaluation
can fail rule evaluation
rules do not get evaluated if the rule parameter does not match the asserted object