I've been working on a web project in which there are core components. tabligs to use those components, pages to use the taglibs, and a database to house the data.
When writing the tests for the package, I used Test::More to cover the core. Apache::Test to test the taglibs and pages in a true HTTP setting. For the database stuff, I decided on using DBD::SQLite. It's an all in one database module.
So the tests load the schema and data via SQL scripts in the terst suite, then I test the core components against that database and verify the results are what I expect.
Of course, this has a potential problem if you are using DB specific features not available in SQLite. But if you're sticking to simple SQL it should be ok.
Update:
For that matter, I chose DBD::SQLite rather than a seperate DB so those test could run in an automated way without and DB connectivity information in at the test location (think CPAN). If DBD::SQLite is installed on the test, tests just hum along without having to interact with the user.
In reply to Re: Testing & Databases
by jk2addict
in thread Testing & Databases
by domm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |