You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

17 lines
389 B

#!/usr/bin/env ruby
require 'test/unit'
require 'hpricot'
require 'load_files'
class TestParser < Test::Unit::TestCase
def test_roundtrip
@basic = Hpricot.parse(TestFiles::BASIC)
%w[link link[2] body #link1 a p.ohmy].each do |css_sel|
ele = @basic.at(css_sel)
assert_equal ele, @basic.at(ele.css_path)
assert_equal ele, @basic.at(ele.xpath)
end
end
end