blib/lib/Morris/Plugin/WithDB.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 22 CC 2 SCAR 12.8
CC
2
Cov
0%
get_dbh
6.0
setup_dbh
2.0
BEGIN
2.0
CRAP 3.6
1 package Morris::Plugin::WithDB;
2 use Moose::Role;
3 use namespace::clean -except => qw(meta);
4  
5 has dbname => (
6 is => 'ro',
7 isa => 'Str',
8 required => 1,
9 );
10  
11 has _setup_done => (
12 is => 'rw',
13 isa => 'Bool',
14 default => 0,
15 );
16  
17 sub get_dbh {
18 my $self = shift;
19 my $dbh = $self->connection->get_dbh( $self->dbname );
20 if (! $self->_setup_done ) {
21 $self->setup_dbh( $dbh );
22 $self->_setup_done(1);
23 }
24 return $dbh;
25 }
26  
27 sub setup_dbh { }
28  
29 1;