From: Its Me Date: 2004-04-16T00:29:14+09:00 Subject: Re: test / unit question: add "Warnings" to Failures and Errors "Simon Strandgaard" wrote in message > def test_something > skip('reason for skipping') if is_win98? > ... > end > > def test_something > todo('what needs to be done') > end > > They all are in the family of tests which cannot be executed for > some reason. > > 124 tests, 300 assertions, 0 failures, 0 errors, > 26 not run (15 disabled, 8 skipping, 3 unimplemented). Hmmm ... different categories of test results reported. Better than a convention such as prefix "x". test/unit has Failures (assert) and Errors (throw or raise), but not Warnings. Perhaps test/unit could add some hooks so (something like) the following would work. class MyTest < Test::Unit::TestCase warnings :todo, :skip # :todo, :skip become warning categories def test_A warn(:todo, "excuse") # reported in warn/todo category end def test_B warn("reason") # warning in warn/other category end end test/unit could bundle some standard warning categories e.g. todo, skip, disabled Internally perhaps test/unit could define a new class to raise: class TestWarning < StandardError; end And rescue these separately from its current AssertionFailedError, reporting these as warning. 124 tests, 300 assertions, 0 failures, 0 errors, 26 warnings (15 disabled, 8 skip, 2 todo, 1 other) ..