Skip to content

Commit

Permalink
Test to reproduce underlying issue for #1060.
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Feb 5, 2015
1 parent 890ef7e commit ceb4e73
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/xml/test_document.rb
Expand Up @@ -809,6 +809,22 @@ def test_dup
assert dup.xml?, 'duplicate should be xml'
end

def test_dup_xml_document_errors
html = "<html><head></head><body><div>replace me</div></body></html>"

doc = Nokogiri::XML::Document.parse(html)
doc2 = doc.dup

child = doc.css('body').children[0]
child2 = doc2.css('body').children[0]

assert_equal doc, child.document
assert_equal doc.errors, child.document.errors

assert_equal doc2, child2.document
assert_equal doc2.errors, child2.document.errors
end

def test_new
doc = nil
doc = Nokogiri::XML::Document.new
Expand Down

0 comments on commit ceb4e73

Please sign in to comment.