[Wtr-general] ruby test unit, recovering from failure

Charley Baker charley.baker at gmail.com
Sat Aug 19 14:45:57 EDT 2006


Hi Manish,

  I'd recommend you try to limit the exception thrown to the specific one
you're looking for and, if possible, narrow it down to a specific method
call as opposed to generalizing it to an entire test case. Secondly in your
rescue block you can either call an assertion or flunk which will be caught
by test unit as a failure.

begin
  some test or method
rescue SomeExpectedException => ex
  flunk("aut broken still, defect #15"+ ex)
end

That's at least one way to report what sounds like needs to be fixed in the
aut without killing the test suite.

-Charley

On 8/19/06, Manish Sapariya <manishs at gs-lab.com> wrote:
>
> If I enclose my test code in
>
> begin
>     rescue
> end
>
> the test suite does not report any exception as failure?
> Any ideas?
> Regards,
> Manish
>
>
> Manish Sapariya wrote:
> > Hi,
> > Is there any way to keep on running my testsuite if one of my test
> raises
> > exceptions which is not handled by the application under test
> gracefully.
> >
> > What if i catch all exception in my testing code?
> > Will test unit report failure for those test cases?
> >
> > Thanks,
> > Manish
> >
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
>
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060819/90ada04d/attachment.html 


More information about the Wtr-general mailing list