Define class derived from RUNIT::TestCase class.
class SimpleTest < RUNIT::TestCase end
If you want to prepare to run test, override setup method.
class SimpleTest < RUNIT::TestCase def setup @fval1 = 2.0 @fval2 = 3.0 end end
Add testXXXX method for running test.
class SimpleTest < RUNIT::TestCase ... def test_add result = @fval1 + @fval2 assert(result == 6.0) end end
Add teardown method if you want to do something after running test.
Now, you can run tests by calling RUNIT::CUI::TestRunner.run method.
RUNIT::CUI::TestRunner.run(SimpleTest.suite)