I solved this in a recent program by keeping all configuration information (including the name of the database driver) in a module. That module had an is_testing() subroutine, which was called in a BEGIN block by the test scripts. This subroutine would change the configuration params to things that made sense for testing (be careful not to change too much, or you'll be testing a system that doesn't reflect what will go on in the real program).
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Testing & Databases
by hardburn
in thread Testing & Databases
by domm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |