From f4ae83498e16d920b6e6b1f239eefa4bc309609d Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 11 Aug 2014 09:35:01 +0200 Subject: [PATCH] Eval specs for the self axis short form. --- spec/oga/xpath/evaluator/axes/self_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/oga/xpath/evaluator/axes/self_spec.rb b/spec/oga/xpath/evaluator/axes/self_spec.rb index 164541c..346bb4e 100644 --- a/spec/oga/xpath/evaluator/axes/self_spec.rb +++ b/spec/oga/xpath/evaluator/axes/self_spec.rb @@ -26,5 +26,17 @@ describe Oga::XPath::Evaluator do it_behaves_like :empty_node_set end + + context 'matching the context node itself using the short form' do + before do + @set = @evaluator.evaluate('a/.') + end + + it_behaves_like :node_set, :length => 1 + + example 'return the node' do + @set[0].should == @document.children[0] + end + end end end