Skip to content

Commit 90d3332

Browse files
committed
XPath.match empty doc, nil doc test case added
1 parent 5f88802 commit 90d3332

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/xpath/test_base.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ def test_root
100100
assert_equal "a", XPath::first( doc, "/" ).elements[1].name
101101
end
102102

103+
def test_empty_doc
104+
assert_equal [], XPath.match([], '*')
105+
end
106+
107+
def test_nil_doc
108+
assert_raise(NoMethodError) {
109+
XPath.match(nil, '*')
110+
}
111+
end
112+
103113
def test_abbreviated_simple_child
104114
assert_equal "a", XPath::first(@@doc, "a").name
105115
end

0 commit comments

Comments
 (0)