Sha256: 7928520c2bc95ae97ee8f675a9e0949416f5719c50c9302bf8f9c8fc8b367f16

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 Bytes

Contents

# $Id: tc_xml_node_xlink.rb 453 2008-07-15 19:36:12Z cfis $
require "libxml"
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

4 entries across 4 versions & 1 rubygems

Version Path
libxml-ruby-0.8.0 test/tc_xml_node_xlink.rb
libxml-ruby-0.8.0-x86-mswin32-60 test/tc_xml_node_xlink.rb
libxml-ruby-0.8.1 test/tc_xml_node_xlink.rb
libxml-ruby-0.8.1-x86-mswin32-60 test/tc_xml_node_xlink.rb