File Coverage

blib/lib/Test2/Plugin/UUID.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 27 28 96.4


line stmt bran cond sub pod time code
1             package Test2::Plugin::UUID;
2 1     1   608510 use strict;
  1         3  
  1         65  
3 1     1   7 use warnings;
  1         2  
  1         84  
4              
5             our $VERSION = '0.002010';
6              
7 1     1   7 use Carp qw/croak/;
  1         2  
  1         68  
8 1     1   6 use Test2::API qw/test2_add_uuid_via/;
  1         3  
  1         241  
9             require Test2::Util::UUID;
10              
11             sub import {
12 4     4   146 my $class = shift;
13              
14 4         23 $class->apply_plugin(@_);
15              
16 4         16 return;
17             }
18              
19             sub apply_plugin {
20 8     8 0 158 my $class = shift;
21              
22 8         45 my $subs = Test2::Util::UUID->get_gen_uuid(@_);
23              
24 8         53 test2_add_uuid_via($subs->{gen_uuid});
25 8         691 require Test2::Hub;
26 8         84 Test2::Hub->new; # Make sure the UUID generator is found
27              
28 8         2324 return $subs->{GEN_UUID_BACKEND}->();
29             }
30              
31             1;
32              
33             __END__