Sha256: 20b0d86ff7b681a99164155c4f8ce09b930f2c2c58fb9e9e76ca3a62bc746838

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 Bytes

Contents

# $Id: tc_xml_node_xlink.rb,v 1.3 2006/04/17 13:30:18 roscopeco Exp $
require "libxml_test"
require 'test/unit'

class TC_XML_Node3 < 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

1 entries across 1 versions & 1 rubygems

Version Path
libxml-ruby-0.3.8 tests/tc_xml_node_xlink.rb