in reply to Re: Testing a DB connect() or die()
in thread [SOLVED]: Testing a DB connect() or die()

Per NetWallah's reply, I changed my code to this:

$self->{db} = DBI->connect( "dbi:SQLite:dbname=$db_file", "", "", {RaiseError => $self->{db_err}} ) or die $DBI::errstr;

...and my tests to send in db_err => 0 in the calls to new(), and I get 100% coverage. I don't think I'll make this a user-visible param (but I will document it) as I always want the upper module to take care of the problem, but to ensure I've covered it, it works.

This was a case of me not reading enough documentation.