Sha256: ba3552e5f721434bb30b59f28bb693fcdde343b62b9a1f4e74d911b532f5856a

Contents?: true

Size: 835 Bytes

Versions: 2

Compression:

Stored size: 835 Bytes

Contents

require "libxml"
require 'test/unit'

class TC_XML_Node7 < Test::Unit::TestCase
  def setup()
    xp = XML::Parser.string('<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>')
    doc = xp.parse
    @root = doc.root
    assert_equal 'bar', @root['foo']
  end

  def teardown()
    @root = nil
  end

  def test_xml_node_properties_traversal_bug()
    prop = @root.properties
    assert_instance_of XML::Attr, prop
    assert_equal 'uga', prop.name
    assert_equal 'booga', prop.value

    prop = prop.next
    assert_instance_of XML::Attr, prop
    assert_equal 'foo', prop.name
    assert_equal 'bar', prop.value
  end

  def test_xml_node_properties_when_no_attributes
    xp = XML::Parser.string("<root></root>")
    doc = xp.parse
    root = doc.root

    assert_nil root.properties
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libxml-ruby-0.5.3 test/tc_xml_node7.rb
libxml-ruby-0.5.4 test/tc_xml_node7.rb