At 09:45 PM 8/2/2005, Jonathan Kohl wrote:
irb(main):008:0> begin
irb(main):009:1* assert(ie.contains_text("Programming Ruby") )
irb(main):010:1> puts("TEST PASSED. Found test string 'Programming Ruby'
")
irb(main):011:1> rescue => e
irb(main):012:1> puts("TEST FAILED." + e.message + "\n" +
e.backtrace.join("\n"))
irb(main):013:1>end
TEST PASSED. Found test string 'Programming Ruby'
Jonathan knows this, but for every one else, this does the same thing, more
simply:
if ie.contains_text("Programming Ruby")
puts("TEST PASSED. Found test string 'Programming Ruby'")
else
puts("TEST FAILED.")
end
This seems to trip a lot of people up. Jonathan, do our docs describe the
simple way before talking about asserts?
Bret
_____________________
Bret Pettichord
www.pettichord.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general