Fixed spec for sum() in a predicate

The return value of sum() should be used as a NodeSet index, not merely
just a truthy value.
This commit is contained in:
Yorick Peterse 2015-08-20 00:54:06 +02:00
parent 94ec1b5f5d
commit 37ac844ebe
1 changed files with 2 additions and 2 deletions

View File

@ -30,8 +30,8 @@ describe Oga::XPath::Compiler do
end
describe 'in a predicate' do
it 'returns a NodeSet containing all matching nodes' do
evaluate_xpath(@document, 'root/a[sum(/root/*)]')
it 'returns a NodeSet containing the first <a> node' do
evaluate_xpath(@document, 'root/a[sum(/root/a)]')
.should == node_set(@a1)
end
end