diff --git a/test/cgi/test_cgi_core.rb b/test/cgi/test_cgi_core.rb index 08a8d383de..123caf7acd 100644 --- a/test/cgi/test_cgi_core.rb +++ b/test/cgi/test_cgi_core.rb @@ -329,7 +329,7 @@ class CGICoreTest < Test::Unit::TestCase end - def test_cgi_core_htmltype + def test_cgi_core_htmltype_header @environ = { 'REQUEST_METHOD' => 'GET', } @@ -337,26 +337,32 @@ class CGICoreTest < Test::Unit::TestCase ## no htmltype cgi = CGI.new assert_raise(NoMethodError) do cgi.doctype end + assert_equal("Content-Type: text/html\r\n\r\n",cgi.header) ## html3 cgi = CGI.new('html3') expected = '' assert_equal(expected, cgi.doctype) + assert_equal("Content-Type: text/html\r\n\r\n",cgi.header) ## html4 cgi = CGI.new('html4') expected = '' assert_equal(expected, cgi.doctype) + assert_equal("Content-Type: text/html\r\n\r\n",cgi.header) ## html4 transitional cgi = CGI.new('html4Tr') expected = '' assert_equal(expected, cgi.doctype) + assert_equal("Content-Type: text/html\r\n\r\n",cgi.header) ## html4 frameset cgi = CGI.new('html4Fr') expected = '' assert_equal(expected, cgi.doctype) + assert_equal("Content-Type: text/html\r\n\r\n",cgi.header) ## html5 cgi = CGI.new('html5') expected = '' assert_equal(expected, cgi.doctype) + assert_match(/^
<\/HEADER>$/i,cgi.header) end