Sha256: 3c40d8e0f044c5c64e4f77d5519e7b9a7b0efa370438fbc9fc45b701e9ed7ba8

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

require 'rexml/document'

describe "REXML::Node#index_in_parent" do
  it "returns the index (starting from 1) of self in parent" do
    e = REXML::Element.new("root")
    node1 = REXML::Element.new("node")
    node2 = REXML::Element.new("another node")
    e << node1
    e << node2

    node1.index_in_parent.should == 1
    node2.index_in_parent.should == 2
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/node/index_in_parent_spec.rb
rubysl-rexml-2.0.3 spec/node/index_in_parent_spec.rb
rubysl-rexml-1.0.0 spec/node/index_in_parent_spec.rb
rubysl-rexml-2.0.2 spec/node/index_in_parent_spec.rb
rubysl-rexml-2.0.1 spec/node/index_in_parent_spec.rb