Corrected the last() compiler spec

This spec didn't match the correct nodes due to `1 < last()` always
evaluating to true in this particular case.
This commit is contained in:
Yorick Peterse 2015-08-20 00:23:40 +02:00
parent 7a4cb76d39
commit 94ec1b5f5d
1 changed files with 3 additions and 2 deletions

View File

@ -14,8 +14,9 @@ describe Oga::XPath::Compiler do
evaluate_xpath(@document, 'root/a[last()]').should == node_set(@a2)
end
it 'returns a NodeSet containing all but the last node' do
evaluate_xpath(@document, 'root/a[1 < last()]').should == node_set(@a1)
it 'returns a NodeSet matching all <a> nodes' do
evaluate_xpath(@document, 'root/a[1 < last()]')
.should == node_set(@a1, @a2)
end
end
end