Doing some Test::Unit work on my CGI scripts, I wondered if anyone
had done any work combining Test::Unit with CGI?
Specifically, I’m thinking:
Create your Test::Unit test case file. Just as it auto-magically
runs the test runner by simply requiring ‘test/unit’ and defining
a class that inherits from Test::Unit::TestCase, I’m thinking if
you require ‘cgi’ – well, if a class named “CGI” is defined – that
the Test::Unit test runner generates its output as a HTML
Perhaps this is too magical: if your testing a CGI script, it’ll
have a CGI class defined and you may not want the output in HTML.
So, maybe defining a flag would be necessary.
I’m just thinking of an easy way of turning a Test::Unit test
case (or suite) into something that can be published to the web
… or, in my case, run the test cases as a CGI script – each hit
to the CGI runs the test cases and sends the results as HTML
back to the browser.
If anyone has already done this, please speak up! I’d love to
use whatever you’ve got. Otherwise, I’m going to start working
on this now.