1
0
Fork 0
This repository has been archived on 2019-12-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
neinomaten/vendor/htree/test/test-raw_string.rb

17 lines
467 B
Ruby

require 'test/unit'
require 'htree'
class TestRawString < Test::Unit::TestCase
def test_elem
t = HTree.parse("<a>x</a>")
assert_equal("<a>x</a>", t.root.raw_string)
assert_equal("<a>x</a>", t.root.raw_string) # raw_string shouldn't have side effect.
end
def test_no_raw_string
t = HTree::Elem.new('a')
assert_equal(nil, t.raw_string)
t = HTree::Elem.new('a', HTree.parse("<a>x</a>").root)
assert_equal(nil, t.raw_string)
end
end