With a module like Class::DBI, the functionality of the module is very dependent on interaction with DBI. A test using mock objects would not be a very good test. The most common way to deal with this now is to use DBD::SQLite, which allows you to make a private database for testing.