Sha256: 14e104c956580561fbd74602e908b538bbe94a55f687a0ae3c69438f72aa0ec3

Contents?: true

Size: 512 Bytes

Versions: 17

Compression:

Stored size: 512 Bytes

Contents

require "xml"
require 'test/unit'

class TestNS < Test::Unit::TestCase
  def test_ns
    node = XML::Node.new('foo')
    ns = XML::NS.new(node, 'http://www.mynamespace.com', 'my_namepace')
    assert_equal(ns.prefix, 'my_namepace')
    assert_equal(ns.href, 'http://www.mynamespace.com')
  end
  
  def test_default_ns
    node = XML::Node.new('foo')
    ns = XML::NS.new(node, 'http://www.mynamespace.com', nil)
    assert_equal(ns.prefix, nil)
    assert_equal(ns.href, 'http://www.mynamespace.com')
  end
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
libxml-jruby-modified-1.0.2-jruby test/tc_ns.rb
libxml-jruby-modified-1.0.1-jruby test/tc_ns.rb
libxml-fixed-jruby-1.0.0-jruby test/tc_ns.rb
libxml-jruby-fixed-1.0.0-jruby test/tc_ns.rb
libxml-jruby-1.0.0 test/tc_ns.rb
libxml-ruby-0.9.1 test/tc_ns.rb
libxml-ruby-0.9.2 test/tc_ns.rb
libxml-ruby-0.9.1-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.3-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.2-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.0 test/tc_ns.rb
libxml-ruby-0.9.0-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.4 test/tc_ns.rb
libxml-ruby-0.9.3 test/tc_ns.rb
libxml-ruby-0.9.5-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.4-x86-mswin32-60 test/tc_ns.rb
libxml-ruby-0.9.5 test/tc_ns.rb