Class::DBI Testing Testing Class::DBI - Facilitating "Best Practices" #11

2. Add a test database class to your Class::DBI library

package Music::TestDB;
use base qw/Class::DBI::Test::TempDB/;

# Rebuild the test db every time we load
__PACKAGE__->build_test_db();

END {
    # Remove the db file every time we unload
    __PACKAGE__->tear_down_connection();
}
Copyright © 2004 Dan Friedman