From: Johan Holmberg Date: 2003-09-15T22:26:24+09:00 Subject: Re: Test::Unit -- multiple errors in test method ??? On Mon, 15 Sep 2003, ts wrote: > > >>>>> "J" == Johan Holmberg writes: > > J> - I have tried to write some table driven tests. How should I do > J> this ? Currently I tried something in the following style: > > Something like this ? > > svg% cat b.rb > #!/usr/bin/ruby > require 'test/unit' > > class TC_example < Test::Unit::TestCase > > @@data = [ > [2, 1, 1, true], > [5, 2, 2, false], # should fail > [7, 2, 5, true], > [8, 3, nil, TypeError], # should fail > ] > [...] No, not really. When I wrote "should fail" I just meant that I had written a line in the table that *as it stands* give an error. A more accurate example would have been if I wrote a @@data table that contained correct addition-results, and had written a faulty addition-function that I then tested. My example maybe was a bit contrived just to keep it short. Ideally I would have liked to have some way to indicate to the Test::Unit framework if the assertions in a certain test method were "ascendent" (using the words from David Corbins previous answer) or not. If they were not "ascendent", then all assertions should have been executed even if some of them "failed". /Johan Holmberg