require'rUnit' include RUnit testSuite :SampleTestSuite do setup do end tearDown do end testCase :TestEqualPass do assertEqual 1.0, 4.0-3.0 end testCase :TestEqualFail do assertEqual 1, 2 end testCase :TestFail do assert1>3 end testCase :TestException do raise 'Exception raised' end end
Output:
SampleTestSuite Passed:TestEqualPass Failed:TestEqualFail (Expected <1> but <2>.) Failed:TestFail (Expected <true> but <false>) Failed:TestException (Exception raised)