From 022d8e0ada4081b81835e929507ed826da880098 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 27 Aug 2014 23:07:38 +0200 Subject: [PATCH] Extra test for sum() for default return values. --- spec/oga/xpath/evaluator/calls/sum_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/oga/xpath/evaluator/calls/sum_spec.rb b/spec/oga/xpath/evaluator/calls/sum_spec.rb index dadaf43..467a134 100644 --- a/spec/oga/xpath/evaluator/calls/sum_spec.rb +++ b/spec/oga/xpath/evaluator/calls/sum_spec.rb @@ -15,5 +15,9 @@ describe Oga::XPath::Evaluator do example 'return the sum of the child nodes of the node' do @evaluator.evaluate('sum(root/*)').should == 3.0 end + + example 'return zero by default' do + @evaluator.evaluate('sum(foo)').should be_zero + end end end