From 9b468f4cd7daa9f1e8122938e6c2c5b8bf235a5f Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Fri, 21 Sep 2007 20:45:49 +0000 Subject: [html-scanner] Fix parsing of empty tags. Closes #7641. [anthony.bailey] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7528 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../test/controller/html-scanner/document_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack/test/controller/html-scanner/document_test.rb') diff --git a/actionpack/test/controller/html-scanner/document_test.rb b/actionpack/test/controller/html-scanner/document_test.rb index a6ba70dde1..0719883f31 100644 --- a/actionpack/test/controller/html-scanner/document_test.rb +++ b/actionpack/test/controller/html-scanner/document_test.rb @@ -75,6 +75,26 @@ class DocumentTest < Test::Unit::TestCase assert_not_nil doc.find(:tag => "div", :children => { :count => 1, :only => { :tag => "table" } }) end + def test_tag_nesting_nothing_to_s + doc = HTML::Document.new("") + assert_equal "", doc.root.to_s + end + + def test_tag_nesting_space_to_s + doc = HTML::Document.new(" ") + assert_equal " ", doc.root.to_s + end + + def test_tag_nesting_text_to_s + doc = HTML::Document.new("text") + assert_equal "text", doc.root.to_s + end + + def test_tag_nesting_tag_to_s + doc = HTML::Document.new("") + assert_equal "", doc.root.to_s + end + def test_parse_cdata doc = HTML::Document.new(<<-HTML)