File Coverage

blib/lib/KiokuDB/Test/Fixture/Clear.pm
Criterion Covered Total %
statement 30 30 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 0 3 0.0
total 42 45 93.3


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package KiokuDB::Test::Fixture::Clear;
4 2     2   1493 use Moose;
  2         3  
  2         13  
5              
6 2     2   9723 use Test::More;
  2         4  
  2         18  
7 2     2   503 use Test::Moose;
  2         2  
  2         15  
8              
9 2     2   752 use KiokuDB::Test::Person;
  2         4  
  2         43  
10              
11 2     2   8 use namespace::clean -except => 'meta';
  2         4  
  2         16  
12              
13 2     2   758 use constant required_backend_roles => qw(Clear);
  2         4  
  2         436  
14              
15             with qw(KiokuDB::Test::Fixture) => { excludes => [qw/sort required_backend_roles/] };
16              
17 18     18 0 30 sub sort { -10 }
18              
19             sub create {
20 33     33 0 97 my $self = shift;
21              
22             return (
23 33         997 KiokuDB::Test::Person->new( name => "foo" ),
24             KiokuDB::Test::Person->new( name => "bar" ),
25             );
26             }
27              
28             sub verify {
29 33     33 0 96 my $self = shift;
30              
31              
32 33     33   287 $self->txn_lives(sub { $self->lookup_ok(@{ $self->populate_ids } ) });
  33         66  
  33         1004  
33              
34 33     33   11571 $self->txn_lives(sub { $self->backend->clear });
  33         171  
35              
36 33     33   11601 $self->txn_lives(sub { $self->deleted_ok(@{ $self->populate_ids }) });
  33         65  
  33         987  
37             }
38              
39             __PACKAGE__->meta->make_immutable;
40              
41             __PACKAGE__
42              
43             __END__
44