Judges
A command line tool and a Ruby gem for running judges agains a factbase.
Every "judge" is a directory with a single .rb file and a number
of .yml files. A script in the Ruby file is executed with the following
global variables available to it:
$fb— an instance ofFactbase, where facts may be added/updated;$loog— an instance ofLoog, where.infoand.debuglogs are welcome;$options— a holder of options coming from.ymlfiles;$local— a hash map that is cleaned up when all tests in the pack are finished;$global— a hash map that is never cleaned up;$judge— the name of the directory, where the.rbscript is located.
Every .yml file must be formatted as such:
input:
-
foo: 42
bar: Hello, world!
options:
max: 100
expected:
- /fb[count(f)=1]
Here, the input is an array of facts to be placed into the Factbase before
the test starts; the options is a hash map of options to be passed
via command line --option of the update command; and expected is
an array of XPath expressions that must be present in the XML of the Factbase
when the test is finished.
How to contribute
Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:
bundle update
bundle exec rake
If it's clean and you don't see any error messages, submit your pull request.