File Coverage

blib/lib/DBICx/TestDatabase/Subclass.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 25 26 96.1


line stmt bran cond sub pod time code
1             package DBICx::TestDatabase::Subclass;
2 2     2   29183 use strict;
  2         5  
  2         57  
3 2     2   10 use warnings;
  2         4  
  2         51  
4              
5 2     2   1610 use File::Temp 'tempfile';
  2         53179  
  2         389  
6              
7             sub connect {
8 1     1 1 15 my ($class) = @_;
9            
10 1         5 my (undef, $filename) = tempfile;
11 1 50       611 my $schema = $class->next::method("DBI:SQLite:$filename")
12             or die "failed to connect to DBI:SQLite:$filename";
13            
14 1         77841 $schema->{_tmpfile} = $filename;
15            
16 1         11 $schema->deploy;
17 1         792685 return $schema;
18             }
19              
20             sub DESTROY {
21 1     1   33738 my ($schema) = @_;
22 1         5 my $tmpfile = $schema->{_tmpfile};
23 1         147 unlink $tmpfile;
24             }
25              
26             1;
27              
28             __END__