Sha256: 0a9defea9a9caf1e1881ca3fe6fbb7fe82f6cc3a8439afaee1e2fea232fd5c8a

Contents?: true

Size: 528 Bytes

Versions: 5

Compression:

Stored size: 528 Bytes

Contents

require 'rexml/document'

describe "REXML::Node#previous_sibling_node" do
  before :each do
    @e = REXML::Element.new("root")
    @node1 = REXML::Element.new("node")
    @node2 = REXML::Element.new("another node")
    @e << @node1
    @e << @node2
  end

  it "returns the previous child node in parent" do
    @node2.previous_sibling_node.should == @node1
  end

  it "returns nil if there are no more child nodes before" do
    @node1.previous_sibling_node.should == nil
    @e.previous_sibling_node.should == nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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