1 require 'abstract_unit'
3 class TextNodeTest
< Test
::Unit::TestCase
5 @node = HTML
::Text.new(nil, 0, 0, "hello, howdy, aloha, annyeong")
9 assert_equal
"hello, howdy, aloha, annyeong", @node.to_s
13 assert_equal
@node, @node.find("hello, howdy, aloha, annyeong")
14 assert_equal
false, @node.find("bogus")
18 assert_equal
@node, @node.find(/an+y/)
19 assert_nil
@node.find(/b/)
23 assert_equal
@node, @node.find(:content => /howdy/)
24 assert_nil
@node.find(:content => /^howdy$/)
25 assert_equal
false, @node.find(:content => "howdy")
29 assert_nil
@node.find(:hello)
33 assert
@node.match("hello, howdy, aloha, annyeong")
34 assert_equal
false, @node.match("bogus")
38 assert_not_nil
@node, @node.match(/an+y/)
39 assert_nil
@node.match(/b/)
43 assert_not_nil
@node, @node.match(:content => "howdy")
44 assert_nil
@node.match(:content => /^howdy$/)
48 assert_nil
@node.match(:hello)