Rewrote context names of some XPath specs.
This commit is contained in:
parent
cdf48979d5
commit
6e2be78546
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe Oga::XPath::Evaluator do
|
||||
context 'ancestor-or-self axis' do
|
||||
before do
|
||||
@document = parse('<a><b><c></c></b><d></d><a></a></a>')
|
||||
@document = parse('<a><b><c></c></b></a>')
|
||||
@c_node = @document.children[0].children[0].children[0]
|
||||
@evaluator = described_class.new(@c_node)
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ describe Oga::XPath::Evaluator do
|
|||
end
|
||||
end
|
||||
|
||||
context 'missing ancestors' do
|
||||
context 'ancestors that only match the context nodes' do
|
||||
before do
|
||||
@set = @evaluator.evaluate('ancestor-or-self::c')
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe Oga::XPath::Evaluator do
|
||||
context 'ancestor axis' do
|
||||
before do
|
||||
@document = parse('<a><b><c></c></b><d></d><a></a></a>')
|
||||
@document = parse('<a><b><c></c></b></a>')
|
||||
@c_node = @document.children[0].children[0].children[0]
|
||||
@evaluator = described_class.new(@c_node)
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ describe Oga::XPath::Evaluator do
|
|||
end
|
||||
end
|
||||
|
||||
context 'missing ancestors' do
|
||||
context 'non existing ancestors' do
|
||||
before do
|
||||
@set = @evaluator.evaluate('ancestor::foobar')
|
||||
end
|
||||
|
|
|
@ -39,7 +39,7 @@ describe Oga::XPath::Evaluator do
|
|||
end
|
||||
end
|
||||
|
||||
context 'missing attributes' do
|
||||
context 'non existing attributes' do
|
||||
before do
|
||||
@set = @evaluator.evaluate('attribute::bar')
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe Oga::XPath::Evaluator do
|
||||
context 'child axis' do
|
||||
before do
|
||||
@document = parse('<a><b><c></c></b><d></d><a></a></a>')
|
||||
@document = parse('<a><b></b></a>')
|
||||
@evaluator = described_class.new(@document)
|
||||
end
|
||||
|
||||
|
@ -31,9 +31,9 @@ describe Oga::XPath::Evaluator do
|
|||
end
|
||||
end
|
||||
|
||||
context 'invalid children' do
|
||||
context 'non existing children' do
|
||||
before do
|
||||
@set = @evaluator.evaluate('child::foobar')
|
||||
@set = @evaluator.evaluate('child::b')
|
||||
end
|
||||
|
||||
it_behaves_like :empty_node_set
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe Oga::XPath::Evaluator do
|
||||
context 'descendant axis' do
|
||||
before do
|
||||
@document = parse('<a><b><c></c></b><d></d><a></a></a>')
|
||||
@document = parse('<a><b><c></c></b><a></a></a>')
|
||||
@evaluator = described_class.new(@document)
|
||||
|
||||
@first_a = @document.children[0]
|
||||
|
@ -50,7 +50,7 @@ describe Oga::XPath::Evaluator do
|
|||
end
|
||||
end
|
||||
|
||||
context 'invalid descendants' do
|
||||
context 'non existing descendants' do
|
||||
before do
|
||||
@set = @evaluator.evaluate('descendant::foobar')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue