From 37ac844ebeb13d3c2355b9b71eedea791614ea57 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 20 Aug 2015 00:54:06 +0200 Subject: [PATCH] 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. --- spec/oga/xpath/compiler/calls/sum_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/oga/xpath/compiler/calls/sum_spec.rb b/spec/oga/xpath/compiler/calls/sum_spec.rb index 19e5cc7..1e4b890 100644 --- a/spec/oga/xpath/compiler/calls/sum_spec.rb +++ b/spec/oga/xpath/compiler/calls/sum_spec.rb @@ -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 node' do + evaluate_xpath(@document, 'root/a[sum(/root/a)]') .should == node_set(@a1) end end