From 94ec1b5f5de7cfd07e9d1b34e5fc540925df499d Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 20 Aug 2015 00:23:40 +0200 Subject: [PATCH] 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. --- spec/oga/xpath/compiler/calls/last_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/oga/xpath/compiler/calls/last_spec.rb b/spec/oga/xpath/compiler/calls/last_spec.rb index 22f1c09..b3f0694 100644 --- a/spec/oga/xpath/compiler/calls/last_spec.rb +++ b/spec/oga/xpath/compiler/calls/last_spec.rb @@ -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 nodes' do + evaluate_xpath(@document, 'root/a[1 < last()]') + .should == node_set(@a1, @a2) end end end