Fixed XPath compiler support for not()
This commit is contained in:
parent
7cbc53c64e
commit
a30cdba8d0
|
@ -927,7 +927,7 @@ module Oga
|
|||
call_arg.assign(arg_ast).followed_by do
|
||||
converted = conversion.to_boolean(call_arg).not
|
||||
|
||||
block_given? ? converted.if_false { yield } : converted
|
||||
block_given? ? converted.if_true { yield } : converted
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@ describe Oga::XPath::Compiler do
|
|||
|
||||
describe 'in a predicate' 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
|
||||
|
|
Loading…
Reference in New Issue