On 3/17/06, Paul Carvalho <[EMAIL PROTECTED]> wrote:
> Hi there, I am having difficulty with an assertion in one of my scripts. I
> couldn't find anything in the Watir API Reference for "assert_equal" and
> when I searched the message archives, I think I'm using it correctly.
It's pure Ruby, no Watir involved.
> Line of code in my script:
> assert_equal("TEST" , $ie.span(:id, /NodeIdentifierLabel/).text )
>
> When I run the script, it fails on that line with the output:
> ----
> 1) Failure:
> test_g_R_n_D(TC_OD_site_map_walkthru)
> [OD_site_map_walkthrough.rb:522]:
> <"TEST"> expected but was
> <".">.
assert_equal is telling you that your code is yielding a single period
and you told it to expect to find "TEST". That's how all of the
asserts work. (Except plain old "assert", which always yields the
error message "FALSE is not TRUE" which isn't very helpful.)
> Is there something I'm doing wrong? Where can I find out more information
> about these assertion commands? The Watir API reference lists a different
> set of commands than are used in the unittests.
Pickaxe v.2 has a nice section on unit testing with test/unit along
with all of the forms of 'assert' available.
-Chris
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general