From 78da274452dae9bb4aed798b87ceada149d0036e Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 11 Aug 2014 00:42:06 +0200 Subject: [PATCH] Updated XPath specs for better namespace handling. --- spec/oga/xpath/evaluator/general_spec.rb | 6 +++--- spec/oga/xpath/evaluator/paths_spec.rb | 2 +- spec/oga/xpath/evaluator/wildcard_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/oga/xpath/evaluator/general_spec.rb b/spec/oga/xpath/evaluator/general_spec.rb index b73f2d0..801432a 100644 --- a/spec/oga/xpath/evaluator/general_spec.rb +++ b/spec/oga/xpath/evaluator/general_spec.rb @@ -26,10 +26,10 @@ describe Oga::XPath::Evaluator do context '#node_matches?' do before do - ns = Oga::XML::Namespace.new(:name => 'x') - @name_node = Oga::XML::Element.new(:name => 'a') - @name_ns_node = Oga::XML::Element.new(:name => 'b', :namespace => ns) + @name_ns_node = Oga::XML::Element.new(:name => 'b', :namespace_name => 'x') + + @name_ns_node.register_namespace('x', 'y') end example 'return true if a node is matched by its name' do diff --git a/spec/oga/xpath/evaluator/paths_spec.rb b/spec/oga/xpath/evaluator/paths_spec.rb index 1f5f92f..d239c3c 100644 --- a/spec/oga/xpath/evaluator/paths_spec.rb +++ b/spec/oga/xpath/evaluator/paths_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Oga::XPath::Evaluator do before do - @document = parse('Foo') + @document = parse('Foo') end context 'absolute paths' do diff --git a/spec/oga/xpath/evaluator/wildcard_spec.rb b/spec/oga/xpath/evaluator/wildcard_spec.rb index c096156..c468f67 100644 --- a/spec/oga/xpath/evaluator/wildcard_spec.rb +++ b/spec/oga/xpath/evaluator/wildcard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Oga::XPath::Evaluator do before do - @document = parse('') + @document = parse('') @evaluator = described_class.new(@document) end