From: Johan Holmberg Date: 2003-09-15T21:45:22+09:00 Subject: Re: Test::Unit -- multiple errors in test method ??? On Mon, 15 Sep 2003, David Corbin wrote: > > > > I've looked at the way JUNIT in Java does the same thing, > > and there I got *all* errors reported. That seems much more useful > > to mee. > > You'd better look more closely. JUnit stops execution of the test at the > first failed assertion. Of course, it doesn't report how many assertions > it's making, so maybe it's less obvious to you. > Yes, I missed that. > > If you've got a number of assertions in one test case, while not > always, often they are "ascendent". That is, the second > asssertion can only really be checked. if the first one is true. > Yes, in case this was a feature I suspected the thinking was like that. But how about these cases ? - the Rubicon tests for Ruby. The test methods test a number of things in the same method. As soon as *any* test fails the whole test suite soon becomes increasingly useless (maybe one could say that there should not be any errors, but that has always been the case when I have tried to run Rubicon ...) - I have tried to write some table driven tests. How should I do this ? Currently I tried something in the following style: ... @@data = [ [2, 1, 1], [5, 2, 2], # should fail [7, 2, 5], [8, 3, 4], # should fail ] def test_b for facit, aa, bb in @@data assert_equal facit, aa + bb end end ... Here I have several tests that are not "increasing". (just before I post this I saw David Alan Blacks answer mentioning Test::Unit::AssertionFailedError. Should I catch that ? ) Thanks for the replies, /Johan Holmberg