Index: test/cgi/test_cgi_tag_helper.rb
===================================================================
--- test/cgi/test_cgi_tag_helper.rb (revision 0)
+++ test/cgi/test_cgi_tag_helper.rb (revision 0)
@@ -0,0 +1,253 @@
+require 'test/unit'
+require 'cgi'
+require 'stringio'
+
+
+class CGICoreTest < Test::Unit::TestCase
+
+
+ def setup
+ #@environ = {
+ # 'SERVER_PROTOCOL' => 'HTTP/1.1',
+ # 'REQUEST_METHOD' => 'GET',
+ # 'SERVER_SOFTWARE' => 'Apache 2.2.0',
+ #}
+ #ENV.update(@environ)
+ end
+
+
+ def teardown
+ @environ.each do |key, val| ENV.delete(key) end
+ $stdout = STDOUT
+ end
+
+
+ def test_cgi_tag_helper_html3
+ @environ = {
+ 'REQUEST_METHOD' => 'GET',
+ }
+ ENV.update(@environ)
+ ## html3
+ cgi = CGI.new('html3')
+ assert_equal('',cgi.a)
+ assert_equal('',cgi.a('bar'))
+ assert_equal('foo',cgi.a{'foo'})
+ assert_equal('foo',cgi.a('bar'){'foo'})
+ assert_equal('',cgi.tt)
+ assert_equal('',cgi.tt('bar'))
+ assert_equal('foo',cgi.tt{'foo'})
+ assert_equal('foo',cgi.tt('bar'){'foo'})
+ assert_equal('',cgi.i)
+ assert_equal('',cgi.i('bar'))
+ assert_equal('foo',cgi.i{'foo'})
+ assert_equal('foo',cgi.i('bar'){'foo'})
+ assert_equal('',cgi.b)
+ assert_equal('',cgi.b('bar'))
+ assert_equal('foo',cgi.b{'foo'})
+ assert_equal('foo',cgi.b('bar'){'foo'})
+ assert_equal('',cgi.u)
+ assert_equal('',cgi.u('bar'))
+ assert_equal('foo',cgi.u{'foo'})
+ assert_equal('foo',cgi.u('bar'){'foo'})
+ assert_equal('',cgi.strike)
+ assert_equal('',cgi.strike('bar'))
+ assert_equal('foo',cgi.strike{'foo'})
+ assert_equal('foo',cgi.strike('bar'){'foo'})
+ assert_equal('',cgi.big)
+ assert_equal('',cgi.big('bar'))
+ assert_equal('foo',cgi.big{'foo'})
+ assert_equal('foo',cgi.big('bar'){'foo'})
+ assert_equal('',cgi.small)
+ assert_equal('',cgi.small('bar'))
+ assert_equal('foo',cgi.small{'foo'})
+ assert_equal('foo',cgi.small('bar'){'foo'})
+ assert_equal('',cgi.sub)
+ assert_equal('',cgi.sub('bar'))
+ assert_equal('foo',cgi.sub{'foo'})
+ assert_equal('foo',cgi.sub('bar'){'foo'})
+ assert_equal('',cgi.sup)
+ assert_equal('',cgi.sup('bar'))
+ assert_equal('foo',cgi.sup{'foo'})
+ assert_equal('foo',cgi.sup('bar'){'foo'})
+ assert_equal('',cgi.em)
+ assert_equal('',cgi.em('bar'))
+ assert_equal('foo',cgi.em{'foo'})
+ assert_equal('foo',cgi.em('bar'){'foo'})
+ assert_equal('',cgi.strong)
+ assert_equal('',cgi.strong('bar'))
+ assert_equal('foo',cgi.strong{'foo'})
+ assert_equal('foo',cgi.strong('bar'){'foo'})
+ assert_equal('',cgi.dfn)
+ assert_equal('',cgi.dfn('bar'))
+ assert_equal('foo',cgi.dfn{'foo'})
+ assert_equal('foo',cgi.dfn('bar'){'foo'})
+ assert_equal('',cgi.code)
+ assert_equal('
',cgi.code('bar'))
+ assert_equal('
foo
',cgi.code{'foo'})
+ assert_equal('foo
',cgi.code('bar'){'foo'})
+ assert_equal('',cgi.samp)
+ assert_equal('',cgi.samp('bar'))
+ assert_equal('foo',cgi.samp{'foo'})
+ assert_equal('foo',cgi.samp('bar'){'foo'})
+ assert_equal('',cgi.kbd)
+ assert_equal('',cgi.kbd('bar'))
+ assert_equal('foo',cgi.kbd{'foo'})
+ assert_equal('foo',cgi.kbd('bar'){'foo'})
+ assert_equal('',cgi.var)
+ assert_equal('',cgi.var('bar'))
+ assert_equal('foo',cgi.var{'foo'})
+ assert_equal('foo',cgi.var('bar'){'foo'})
+ assert_equal('',cgi.cite)
+ assert_equal('',cgi.cite('bar'))
+ assert_equal('foo',cgi.cite{'foo'})
+ assert_equal('foo',cgi.cite('bar'){'foo'})
+ assert_equal('',cgi.font)
+ assert_equal('',cgi.font('bar'))
+ assert_equal('foo',cgi.font{'foo'})
+ assert_equal('foo',cgi.font('bar'){'foo'})
+ assert_equal('
foo',cgi.pre{'foo'}) + assert_equal('
foo',cgi.pre('bar'){'foo'}) + assert_equal('