From a61540cfc5bf20db914432e920b2201d3aae9f55 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 9 Jul 2014 23:55:09 +0200 Subject: [PATCH] XPath specs for wildcard names + namespaces. --- spec/oga/xpath/evaluator/wildcard_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/oga/xpath/evaluator/wildcard_spec.rb b/spec/oga/xpath/evaluator/wildcard_spec.rb index 20c448c..2c1a8ce 100644 --- a/spec/oga/xpath/evaluator/wildcard_spec.rb +++ b/spec/oga/xpath/evaluator/wildcard_spec.rb @@ -65,4 +65,26 @@ describe Oga::XPath::Evaluator do @set[0].namespace.should == 'ns1' end end + + context 'name and namespace wildcards' do + before do + @set = @evaluator.evaluate('a/*:*') + end + + example 'return the right amount of rows' do + @set.length.should == 3 + end + + example 'include the first node' do + @set[0].name.should == 'b' + end + + example 'include the second node' do + @set[1].name.should == 'b' + end + + example 'include the node' do + @set[2].name.should == 'c' + end + end end