Skip to content

Commit

Permalink
add a failing test for issue #796.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshahid committed Mar 16, 2013
1 parent 9b406a1 commit 2cc0529
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/html/test_document_fragment.rb
Expand Up @@ -24,14 +24,20 @@ def test_html_parse_encoding
end
end

# issue 863
# issue #863
def test_no_extra_elements
# we should not add an extra <table> element to wrap the fragment
expected_html = "<tr><td>yeah yeah</td></tr>"
actual_html = Nokogiri::HTML.fragment(expected_html).to_html
assert_equal(expected_html, actual_html)
end

# issue #796
def test_whitespace_doc_fragment
fragment = Nokogiri::HTML::DocumentFragment.parse(" ")
assert_empty fragment.children
end

def test_colons_are_not_removed
doc = Nokogiri::HTML::DocumentFragment.parse("<span>3:30pm</span>")
assert_match(/3:30/, doc.to_s)
Expand Down

0 comments on commit 2cc0529

Please sign in to comment.