XPath parsing spec for axes with predicates

This commit is contained in:
Yorick Peterse 2015-03-18 23:55:51 +01:00
parent 7b8c596ccc
commit 6039e1dbeb
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,13 @@ describe Oga::XPath::Parser do
)
end
it 'parses the ancestor axis with a predicate' do
parse_xpath('/ancestor::A[1]').should == s(
:absolute_path,
s(:predicate, s(:axis, 'ancestor', s(:test, nil, 'A')), s(:int, 1))
)
end
it 'parses the ancestor-or-self axis' do
parse_xpath('/ancestor-or-self::A').should == s(
:absolute_path,