Citron is classic unit testing framework with a clear domain specific language notating test case and test procedure, that runs on top of the Ruby Universal Test Harness, Ruby Test.
Citron is classic unit testing framework with a clear domain specific language notating test case and test procedure, that runs on top of the Ruby Universal Test Harness, Ruby Test.
Citron tests are organized into test cases and test procedures. Here is an example:
TestCase "Show them how to Beat It" do # fail test "show them how to funky" do "funky".assert != "funky" end # pass test "show them what's right" do "right".assert == "right" end # error test "no one wants to be defeated" do raise SyntaxError end # pending test "better do what you can" do raise NotImplementedError end # sub-case context "just beat it" do skip "jruby can't funcky" if jruby? test "beat it, beat it, beat it..." do refute jruby? end end end
The assertion framework is actually independent of the test framework, so almost any assertion system will work. In the example above we are using A.E.