Class IndexedNodeTest
In: lib/indexed_node.rb
Parent: Test::Unit::TestCase

Methods

Public Instance methods

[Source]

# File lib/indexed_node.rb, line 51
  def test_chevron
    s = IndexedNode.new(1)
    assert_equal(0, s.size)
    s << IndexedNode.new(2)
    assert_equal(1, s.size)
  end

[Source]

# File lib/indexed_node.rb, line 38
  def test_crochet_equal
    s = IndexedNode.new(1)
    assert_nothing_raised { s[0] = IndexedNode.new(10) }
    assert_raises(TypeError) { s[1] = nil }
  end

[Source]

# File lib/indexed_node.rb, line 44
  def test_merge
    s = IndexedNode.new(1)
    s11 = IndexedNode.new(11)
    s12 = IndexedNode.new(12)
    s.merge!({ 0 => s11, 1 => s12 })
  end

[Source]

# File lib/indexed_node.rb, line 29
  def test_simple
    s11 = IndexedNode.new(11)
    s12 = IndexedNode.new(12)
    s = IndexedNode.new(1, s11, s12)
    assert_equal(1, s.data)
    assert_equal(s11, s.sub_nodes[0])
    assert_equal(s12, s.sub_nodes[1])
  end

[Validate]