Fixed XPath compiler support for not()

This commit is contained in:
Yorick Peterse 2015-08-18 16:57:14 +02:00
parent 7cbc53c64e
commit a30cdba8d0
2 changed files with 3 additions and 2 deletions

View File

@ -927,7 +927,7 @@ module Oga
call_arg.assign(arg_ast).followed_by do call_arg.assign(arg_ast).followed_by do
converted = conversion.to_boolean(call_arg).not converted = conversion.to_boolean(call_arg).not
block_given? ? converted.if_false { yield } : converted block_given? ? converted.if_true { yield } : converted
end end
end end

View File

@ -28,7 +28,8 @@ describe Oga::XPath::Compiler do
describe 'in a predicate' do describe 'in a predicate' do
it 'returns a NodeSet containing all matching nodes ' do it 'returns a NodeSet containing all matching nodes ' do
evaluate_xpath(@document, 'root[not(node())]').should == node_set(@root) evaluate_xpath(@document, 'root[not(comment())]')
.should == node_set(@root)
end end
end end
end end