From: Timothy Goddard Date: 2006-10-27T06:40:21+09:00 Subject: Re: Test::Unit need help with assert Shayne Bateman wrote: > Alright, I'm not too bright sometimes :) > > I just realized the asserts are counted every time it runs and the final > output tallies them all up. > > So, the real question now is, how do I prevent a failed assert from > stopping the testcase it is in? > > Thanks > > -- > Posted via http://www.ruby-forum.com/. Unit tests aren't meant for counting how many assertions fail, they're meant to indicate where problems are so they can be fixed. You may want to divide your tests up further if you need fine grained details. If you absolutely have to do all tests you may want to do something like this: ... def test_something failed = [] failed << :first_test unless condition1 failed << :second_test unless condition2 assert failed == [], "#{failed.length} tests failed: #{failed.map{|e| e.to_s}.join(', ')}" end ... If you're trying to bend Ruby to your will then you're thinking wrong.