Support for using namespace-uri() with attributes.
This commit is contained in:
1 parent
0d41693bfc
commit
da09f1296c
2 files changed
+6
-2
No files matched your search
@@ -3,7 +3,7 @@ require 'spec_helper'
|
||||
describe Oga::XPath::Evaluator do
|
||||
context 'namespace-uri() function' do
|
||||
before do
|
||||
@document = parse('<root xmlns:x="y"><x:a></x:a><b></b></root>')
|
||||
@document = parse('<root xmlns:x="y"><x:a></x:a><b x:num="10"></b></root>')
|
||||
@evaluator = described_class.new(@document)
|
||||
end
|
||||
|
||||
@@ -12,6 +12,10 @@ describe Oga::XPath::Evaluator do
|
||||
@evaluator.evaluate('namespace-uri(root/x:a)').should == 'y'
|
||||
end
|
||||
|
||||
example 'return the namespace URI of the "num" attribute' do
|
||||
@evaluator.evaluate('namespace-uri(root/b/@x:num)').should == 'y'
|
||||
end
|
||||
|
||||
example 'return an empty string when there is no namespace URI' do
|
||||
@evaluator.evaluate('namespace-uri(root/b)').should == ''
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user