diff options
Diffstat (limited to 'spec/ruby/library/rexml/node')
6 files changed, 0 insertions, 123 deletions
diff --git a/spec/ruby/library/rexml/node/each_recursive_spec.rb b/spec/ruby/library/rexml/node/each_recursive_spec.rb deleted file mode 100644 index dd4aa9a2f2..0000000000 --- a/spec/ruby/library/rexml/node/each_recursive_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_relative '../../../spec_helper' -require 'rexml/document' - -describe "REXML::Node#each_recursive" do - before :each do - @doc = REXML::Document.new - @doc << REXML::XMLDecl.new - @root = REXML::Element.new "root" - @child1 = REXML::Element.new "child1" - @child2 = REXML::Element.new "child2" - @root << @child1 - @root << @child2 - @doc << @root - end - - it "visits all subnodes of self" do - nodes = [] - @doc.each_recursive { |node| nodes << node} - nodes.should == [@root, @child1, @child2] - end -end diff --git a/spec/ruby/library/rexml/node/find_first_recursive_spec.rb b/spec/ruby/library/rexml/node/find_first_recursive_spec.rb deleted file mode 100644 index ba46f2ca35..0000000000 --- a/spec/ruby/library/rexml/node/find_first_recursive_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require_relative '../../../spec_helper' -require 'rexml/document' - -describe "REXML::Node#find_first_recursive" do - before :each do - @e = REXML::Element.new("root") - @node1 = REXML::Element.new("node") - @node2 = REXML::Element.new("another node") - @subnode = REXML::Element.new("another node") - @node1 << @subnode - @e << @node1 - @e << @node2 - end - - it "finds the first element that matches block" do - found = @e.find_first_recursive { |n| n.to_s == "<node><another node/></node>"} - found.should == @node1 - end - - it "visits the nodes in preorder" do - found = @e.find_first_recursive { |n| n.to_s == "<another node/>"} - found.should == @subnode - found.should_not == @node2 - end -end diff --git a/spec/ruby/library/rexml/node/index_in_parent_spec.rb b/spec/ruby/library/rexml/node/index_in_parent_spec.rb deleted file mode 100644 index 092851e3e7..0000000000 --- a/spec/ruby/library/rexml/node/index_in_parent_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_relative '../../../spec_helper' -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 diff --git a/spec/ruby/library/rexml/node/next_sibling_node_spec.rb b/spec/ruby/library/rexml/node/next_sibling_node_spec.rb deleted file mode 100644 index 2e8601627d..0000000000 --- a/spec/ruby/library/rexml/node/next_sibling_node_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_relative '../../../spec_helper' -require 'rexml/document' - -describe "REXML::Node#next_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 next child node in parent" do - @node1.next_sibling_node.should == @node2 - end - - it "returns nil if there are no more child nodes next" do - @node2.next_sibling_node.should == nil - @e.next_sibling_node.should == nil - end -end diff --git a/spec/ruby/library/rexml/node/parent_spec.rb b/spec/ruby/library/rexml/node/parent_spec.rb deleted file mode 100644 index d88ba69657..0000000000 --- a/spec/ruby/library/rexml/node/parent_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require_relative '../../../spec_helper' -require 'rexml/document' - -describe "REXML::Node#parent?" do - it "returns true for Elements" do - e = REXML::Element.new("foo") - e.parent?.should == true - end - - it "returns true for Documents" do - e = REXML::Document.new - e.parent?.should == true - end - - # This includes attributes, CDatas and declarations. - it "returns false for Texts" do - e = REXML::Text.new("foo") - e.parent?.should == false - end -end diff --git a/spec/ruby/library/rexml/node/previous_sibling_node_spec.rb b/spec/ruby/library/rexml/node/previous_sibling_node_spec.rb deleted file mode 100644 index 8b96f1565a..0000000000 --- a/spec/ruby/library/rexml/node/previous_sibling_node_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_relative '../../../spec_helper' -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 |
