From 670e22e3724791f51d639f409930fba5af920081 Mon Sep 17 00:00:00 2001 From: Jimmy Baker Date: Tue, 24 Jun 2008 22:21:58 -0700 Subject: Patched HTML::Document#initialize call to Node.parse so that it includes the strict argument. [#330] --- .../test/controller/html-scanner/document_test.rb | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/html-scanner/document_test.rb b/actionpack/test/controller/html-scanner/document_test.rb index 0519533dbd..1c3facb9e3 100644 --- a/actionpack/test/controller/html-scanner/document_test.rb +++ b/actionpack/test/controller/html-scanner/document_test.rb @@ -120,4 +120,29 @@ HTML assert doc.find(:tag => "div", :attributes => { :id => "map" }, :content => "") assert doc.find(:tag => "div", :attributes => { :id => "map" }, :content => nil) end + + def test_parse_invalid_document + assert_nothing_raised do + doc = HTML::Document.new(" + + + + +
About Us
+ ") + end + end + + def test_invalid_document_raises_exception_when_strict + assert_raises RuntimeError do + doc = HTML::Document.new(" + + + + +
About Us
+ ", true) + end + end + end -- cgit v1.2.3