Sha256: 702ca98dd3245aa77e7c527abd2fd6b8b92e401d97b857f8ad7a30dcef99353b
Contents?: true
Size: 946 Bytes
Versions: 19
Compression:
Stored size: 946 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), '..', "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
19 entries across 19 versions & 2 rubygems