Skip to content

Commit

Permalink
limit test of libxml-specific DocumentFragment#dup behavior
Browse files Browse the repository at this point in the history
... to only running when testing the libxml2 impl.

Related to #1846 and #1063.
  • Loading branch information
flavorjones committed Dec 18, 2018
1 parent 2e15c88 commit db26a04
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/xml/test_document_fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ def test_issue_1077_parsing_of_frozen_strings
Nokogiri::XML::DocumentFragment.parse(input) # assert_nothing_raised
end

def test_dup_should_exist_in_a_new_document
# https://github.com/sparklemotion/nokogiri/issues/1063
original = Nokogiri::XML::DocumentFragment.parse("<div><p>hello</p></div>")
duplicate = original.dup
assert_not_equal original.document, duplicate.document
if Nokogiri.uses_libxml?
def test_dup_should_exist_in_a_new_document
# https://github.com/sparklemotion/nokogiri/issues/1063
original = Nokogiri::XML::DocumentFragment.parse("<div><p>hello</p></div>")
duplicate = original.dup
assert_not_equal original.document, duplicate.document
end
end

def test_dup_should_create_an_xml_document_fragment
Expand Down

0 comments on commit db26a04

Please sign in to comment.