Sha256: 08ce3e3bf6b096880f11b3e5f4812ae2941b90502c8f95280d6929357f6f6c2a

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 Bytes

Contents

# $Id$
require "xml"
require 'test/unit'

class TC_XML_Node_XLink < Test::Unit::TestCase
  def setup()
    xp = XML::Parser.new()
    str = '<ruby_array xmlns:xlink="http://www.w3.org/1999/xlink/namespace/"><fixnum xlink:type="simple">one</fixnum></ruby_array>'
    assert_equal(str, xp.string = str)
    doc = xp.parse
    assert_instance_of(XML::Document, doc)
    @root = doc.root
    assert_instance_of(XML::Node, @root)
  end

  def teardown()
    @root = nil
  end

  def test_xml_node_xlink()
    for elem in @root.find('fixnum')
      assert_instance_of(XML::Node, elem)
      assert_instance_of(TrueClass, elem.xlink?)
      assert_equal("simple", elem.xlink_type_name)
      assert_equal(XML::Node::XLINK_TYPE_SIMPLE, elem.xlink_type)
    end
  end
end

Version data entries

5 entries across 5 versions & 4 rubygems

Version Path
libxml-jruby-modified-1.0.2-jruby test/tc_node_xlink.rb
libxml-jruby-modified-1.0.1-jruby test/tc_node_xlink.rb
libxml-fixed-jruby-1.0.0-jruby test/tc_node_xlink.rb
libxml-jruby-fixed-1.0.0-jruby test/tc_node_xlink.rb
libxml-jruby-1.0.0 test/tc_node_xlink.rb