Hi.

I have followed the documentation at http://wtr.rubyforge.org/watir_user_guide.html and I can not see why I shouldn't use assert??  Are there some rules to using assert? 

The thing I don't understand is that very similar code in test_logger1.rb works but mine does not.  I have not worked out the difference.

Thanks
Ian


On 8/30/05, Bret Pettichord <[EMAIL PROTECTED]> wrote:
You shouldn't use assert in this situation. Instead:

if $ie.contains_text("TestGroup")
     $logger.log("test_CreateGroupTest-TestGroup Found-TestGroup
Found-PASSED")
     $logger.log_results("test_CreateGroupTest", "TestGroup Found",
"TestGroup Found", "PASSED")
else
     puts("TEST FAILED." + e.message + "\n" + e.backtrace.join("\n"))
     $logger.log_results("test_CreateGroupTest", "TestGroup Found",
"TestGroup NOT Found", "FAILED")
end


At 09:09 AM 8/30/2005, Ian Phillips wrote:
>Hi.
>
>I have the following assert below.  When this code is executed I get both
>PASSED and FAILED messages reported??
>
>begin
>     assert($ie.contains_text("TestGroup"))
>     $logger.log("test_CreateGroupTest-TestGroup Found-TestGroup
> Found-PASSED")
>     $logger.log_results("test_CreateGroupTest", "TestGroup Found",
> "TestGroup Found", "PASSED")
>rescue =>e
>     puts("TEST FAILED." + e.message + "\n" + e.backtrace.join("\n"))
>     $logger.log_results("test_CreateGroupTest", "TestGroup Found",
> "TestGroup NOT Found", "FAILED")
>end
>
>
>This is the output
>
>
>log test_CreateGroupTest-TestGroup Found-TestGroup Found-PASSED
>log XML file output: Test case: test_CreateGroupTest input: TestGroup
>Found expe
>cted: TestGroup Found status: PASSED
>TEST FAILED.closed stream
>./example_logger1.rb:62:in `write'
>./example_logger1.rb:62:in `puts'
>./example_logger1.rb:62:in `log_results'
>./CreateNewGroup_tst.rb:70:in `test_CreateGroupTest'
>c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `__send__'
>c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each'
>c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:in `run_suite'
>c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:65:in `start_mediator'
>c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:39:in `start'
>c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:27:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:194:in `run'
>c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:14:in `run'
>c:/ruby/lib/ruby/1.8/test/unit.rb:285
>c:/ruby/lib/ruby/1.8/test/unit.rb:283
>log XML file output: Test case: test_CreateGroupTest input: TestGroup
>Found expe
>cted: TestGroup NOT Found status: FAILED
>
>
>I was assuming I would get one or the other?
>
>Ian
>_______________________________________________
>Wtr-general mailing list
>Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general

_____________________
  Bret Pettichord
  www.pettichord.com

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to