On 10/26/05, Jeff Wood <[EMAIL PROTECTED]> wrote:
> There are two problems ... #1 you can't use the assert functions unless you
> are building a TestCase object...
>
> #2 you don't need the search_html function.
(Gah, I hate it when my emails don't get sent.. here's another try)
Thanks for your help Jeff.. I jury-rigged your example. I have some
preferences I'm leaning towards, so I do like making the function
(easier reusability). The below example works:
require 'Watir' # the watir controller
include Watir
class Watir::IE
# $ie.contains_html( ) returns true/false
def contains_html( input )
html.scan( input ) != []
end
end
def search_html(string)
if $ie.contains_html(string)
puts " ok -- found " + string
else
puts ">>>FAIL -- could not find " + string
end
end
$ie = Watir::IE.start("http://example.com")
search_html(".")
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general