diff --git a/test/xml/test_node_reparenting.rb b/test/xml/test_node_reparenting.rb index abcbdd8f969..445a18701f5 100644 --- a/test/xml/test_node_reparenting.rb +++ b/test/xml/test_node_reparenting.rb @@ -49,6 +49,15 @@ class TestNodeReparenting < Nokogiri::TestCase # end # end + + before do + @doc = Nokogiri::XML "First nodeSecond nodeThird node" + @doc2 = @doc.dup + @fragment_string = "foobar" + @fragment = Nokogiri::XML::DocumentFragment.parse @fragment_string + @node_set = Nokogiri::XML("foobar").xpath("/root/node()") + end + { :add_child => {:target => "/root/a1", :returns_self => false, :children_tags => %w[text b1 b2]}, :<< => {:target => "/root/a1", :returns_self => true, :children_tags => %w[text b1 b2]}, @@ -67,15 +76,6 @@ class TestNodeReparenting < Nokogiri::TestCase :next= => {:target => "/root/a1/text()", :returns_self => false, :children_tags => %w[text b1 b2]}, :after => {:target => "/root/a1/text()", :returns_self => true, :children_tags => %w[text b1 b2]} }.each do |method, params| - - before do - @doc = Nokogiri::XML "First nodeSecond nodeThird node" - @doc2 = @doc.dup - @fragment_string = "foobar" - @fragment = Nokogiri::XML::DocumentFragment.parse @fragment_string - @node_set = Nokogiri::XML("foobar").xpath("/root/node()") - end - describe "##{method}" do describe "passed a Node" do [:current, :another].each do |which|