Raise for non node sets in the sum() function.
According to the XPath spec this function *can only* take node sets, nothing else. Lets actually enforce that.
This commit is contained in:
1 parent
ac06670c24
commit
7c68f2a49b
2 files changed
+10
No files matched your search
@@ -19,5 +19,11 @@ describe Oga::XPath::Evaluator do
|
||||
example 'return zero by default' do
|
||||
@evaluator.evaluate('sum(foo)').should be_zero
|
||||
end
|
||||
|
||||
example 'raise a TypeError for non node set arguments' do
|
||||
block = lambda { @evaluator.evaluate('sum("foo")') }
|
||||
|
||||
block.should raise_error(TypeError)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user