Sha256: d10497674571c58c94b266adae117fea079e4a6a8d8c899f2c20c41f89dd74a5
Contents?: true
Size: 887 Bytes
Versions: 72
Compression:
Stored size: 887 Bytes
Contents
require "helper" module Nokogiri module XML class TestNodeAttributes < Nokogiri::TestCase def test_attribute_with_ns doc = Nokogiri::XML <<-eoxml <root xmlns:tlm='http://tenderlovemaking.com/'> <node tlm:foo='bar' foo='baz' /> </root> eoxml node = doc.at('node') assert_equal 'bar', node.attribute_with_ns('foo', 'http://tenderlovemaking.com/').value end def test_namespace_key? doc = Nokogiri::XML <<-eoxml <root xmlns:tlm='http://tenderlovemaking.com/'> <node tlm:foo='bar' foo='baz' /> </root> eoxml node = doc.at('node') assert node.namespaced_key?('foo', 'http://tenderlovemaking.com/') assert node.namespaced_key?('foo', nil) assert !node.namespaced_key?('foo', 'foo') end end end end
Version data entries
72 entries across 72 versions & 15 rubygems