Skip to content

Commit

Permalink
Test reproducing the underlying bug in #1060.
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Byman <jakebyman@yahoo.com>
  • Loading branch information
flavorjones committed Feb 7, 2015
1 parent c154c90 commit 61b303c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/xml/test_document.rb
Expand Up @@ -820,6 +820,24 @@ def test_dup
assert dup.xml?, 'duplicate should be xml'
end

def test_dup_xml_document_errors
html = "<html><body><div>error!</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 doc.errors.length > 0

assert_equal doc2, child2.document
assert_equal doc2.errors, child2.document.errors
assert doc2.errors.length > 0
end

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

0 comments on commit 61b303c

Please sign in to comment.