Eval specs for the descendant-or-self short axis.

This currently fails due to the node() function not being implemented just yet.
This commit is contained in:
Yorick Peterse 2014-08-11 09:33:09 +02:00
parent aef3e0f27e
commit ffcefa92a7
1 changed files with 28 additions and 0 deletions

View File

@ -87,5 +87,33 @@ describe Oga::XPath::Evaluator do
it_behaves_like :empty_node_set it_behaves_like :empty_node_set
end end
context 'direct descendants using the short form' do
before do
@set = @evaluator.evaluate('//b')
end
it_behaves_like :node_set, :length => 2
example 'return the first <b> node' do
@set[0].should == @first_b
end
example 'return the second <b> node' do
@set[1].should == @second_b
end
end
context 'nested descendants using the short form' do
before do
@set = @evaluator.evaluate('//c')
end
it_behaves_like :node_set, :length => 1
example 'return the <c> node' do
@set[0].should == @first_c
end
end
end end
end end