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:
parent
94ec1b5f5d
commit
37ac844ebe
|
@ -30,8 +30,8 @@ describe Oga::XPath::Compiler do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'in a predicate' do
|
describe 'in a predicate' do
|
||||||
it 'returns a NodeSet containing all matching nodes' do
|
it 'returns a NodeSet containing the first <a> node' do
|
||||||
evaluate_xpath(@document, 'root/a[sum(/root/*)]')
|
evaluate_xpath(@document, 'root/a[sum(/root/a)]')
|
||||||
.should == node_set(@a1)
|
.should == node_set(@a1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue