[Wtr-general] I am having problems with assert -- undefined method `assert'
Bret Pettichord
bret at pettichord.com
Tue Oct 10 00:39:33 EDT 2006
Eva wrote:
> Hi,
>
> I used the following assert script from the logger example (test_logger1.rb)
> begin
> assert($ie.contains_text("Client") )
> $logger.log("Passed. Found test string 'Client' ")
> $logger.log_results("Employee Tests", "TEST PASSED.") #logs to both the XML file and corelogger
> rescue => e
> $logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n"))
> $logger.log_results("Employee Tests", "TEST FAILED.") #logs to both the XML file and corelogger
> end
>
> I receive this error
> *FAILED*.undefined method `assert' for main:Object
>
We have found that the assert/rescue logic described here is both
confusing and, if misunderstood, capable of creating horrible errors in
scripts that allow errors to not be reported.
Consequently, I have revised these examples to avoid the assert/rescue
logic. These are attached.
Bret
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_logger1.rb
Url: http://rubyforge.org/pipermail/wtr-general/attachments/20061009/c5ec5781/attachment.ksh
More information about the Wtr-general
mailing list