That's because you're swallowing the exception in your rescue clause. You want it to be raised and caught by Test::Unit so that it can see it for reporting. You need to either  get rid of the rescue and ensure blocks or rethrow the  exception (in which case you might want to wrap the original exception).

    raise Test::Unit::AssertionFailedError,
"in my testcase: #{e.message}",
e.backtrace


-Charley

On 6/12/06, Adrian Rutter <[EMAIL PROTECTED]> wrote:


Brett wrote
> You are referencing a buggy version of our documentation. Please see
> http://wtr.rubyforge.org/watir_user_guide.html

But if the text is not found,

e.g.
require 'watir'
require 'test/unit'
class TC_1 < Test::Unit::TestCase
  def  test_1
    ie = Watir::IE.new
    ie.goto(' www.tnt.com')
    assert(ie.contains_text ("ZXVX"))
    rescue => e
      puts(e.message + "\n" + e.backtrace.join("\n"))
    ensure
    ie.close
  end

end


An exception is raised and this non-failure is presented in the console

1 tests, 1 assertions, 0 failures, 0 errors

Cheers

Aidy



---------------------------------------------------------------------------------------------------------------
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure.
If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system.
If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
---------------------------------------------------------------------------------------------------------------
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to