joesb.coe9
6/13/2006 9:58:00 AM
aidy wrote:
> Hi joesb
>
> >You seems to be using UnitTest in a different way people usually use.
> >When using RUnit, you don't check the result of assertion yourself, nor
> >do you report the result of assertion yourself.
>
> Yes, I run my tests from suites
>
> class TS_Common_Sales_E2
> suite = Test::Unit::TestSuite.new
>
> suite << ST_LTD_3.suite
> suite << ST_MSR_1.suite
>
> .....
> end
>
> However, the problem, I am having is that test code and production code
> are not equivalent. An exception thrown for a developer may be fine,
> but an automated tester needs to be told where that failure occurs.So I
> find myself in the difficult situation of having a verification point,
> an assert and exception handling
>
> verify_result(string_to_search)
> assert($ie.contains_text(string_to_search))
> rescue => e
> raise Test::Unit::AssertionFailedError,
> "test failed: #{e.message}",
> e.backtrace
> ensure
> log_out
> close_window
>
>
Huh? I'm getting confused here. So above is part of your program?
I think it's unusual to have the production code directly using
UnitTest.
UnitTest code is usually separate from production code. Unit tester
uses different code to test/assert/report from the code use in
production. The production code should never do the assert themselves.
And when assert of RUnit fail, doesn't it automatically generate
backtrace in report?
> Thanks
>
> Aidy