Skip to content

Commit

Permalink
fix test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Feb 21, 2016
1 parent d464aeb commit 6cdb49b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/xml/test_node_reparenting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ class TestNodeReparenting < Nokogiri::TestCase
# end
# end


before do
@doc = Nokogiri::XML "<root><a1>First node</a1><a2>Second node</a2><a3>Third <bx />node</a3></root>"
@doc2 = @doc.dup
@fragment_string = "<b1>foo</b1><b2>bar</b2>"
@fragment = Nokogiri::XML::DocumentFragment.parse @fragment_string
@node_set = Nokogiri::XML("<root><b1>foo</b1><b2>bar</b2></root>").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]},
Expand All @@ -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 "<root><a1>First node</a1><a2>Second node</a2><a3>Third <bx />node</a3></root>"
@doc2 = @doc.dup
@fragment_string = "<b1>foo</b1><b2>bar</b2>"
@fragment = Nokogiri::XML::DocumentFragment.parse @fragment_string
@node_set = Nokogiri::XML("<root><b1>foo</b1><b2>bar</b2></root>").xpath("/root/node()")
end

describe "##{method}" do
describe "passed a Node" do
[:current, :another].each do |which|
Expand Down

1 comment on commit 6cdb49b

@flavorjones
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you.

Please sign in to comment.