From: ts Date: 2003-09-15T22:41:02+09:00 Subject: Re: Test::Unit -- multiple errors in test method ??? >>>>> "J" == Johan Holmberg writes: J> No, not really. J> When I wrote "should fail" I just meant that I had written a line in J> the table that *as it stands* give an error. Then this ? svg% cat b.rb #!/usr/bin/ruby require 'test/unit' class TC_example < Test::Unit::TestCase @@data = [ [2, 1, 1], [5, 2, 2], # should fail [7, 2, 5], [8, 3, 7], # should fail ] def test_a error = [] for facit, aa, bb in @@data begin assert_equal(facit, aa + bb) rescue Exception error << $! end end error.each {|e| add_failure(e.message, e.backtrace) } end end svg% svg% b.rb Loaded suite ./b Started FF Finished in 0.002194 seconds. 1) Failure!!! test_a(TC_example) [./b.rb:17]: <5> expected but was <4> 2) Failure!!! test_a(TC_example) [./b.rb:17]: <8> expected but was <10> 1 tests, 4 assertions, 2 failures, 0 errors svg% Guy Decoux