P is for Practical | |
PerlMonks |
Re: Unit Testing CGI Programsby dws (Chancellor) |
on Mar 15, 2003 at 00:15 UTC ( [id://243216]=note: print w/replies, xml ) | Need Help?? |
Does that sound like Doing The Right Thing, or is there some nifty trick out there that I'm missing?
The pieces you have can be unit tested individually if you break them out. Philosophically, you're doing three things:
On the "trick" side, here's one I've gotten mileage out of: Instead of hard-coding the template name, soft code it in a way that your test harness can change it to use a debugging template. The debugging template strips out everything unnecessary, leaving you with a result (and expanded template) that's easy to verify programmatically.
In Section
Seekers of Perl Wisdom
|
|