File Coverage

blib/lib/Test2/Require/EnvVar.pm
Criterion Covered Total %
statement 17 17 100.0
branch 4 4 100.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package Test2::Require::EnvVar;
2 1     1   7 use strict;
  1         7  
  1         46  
3 1     1   6 use warnings;
  1         1  
  1         28  
4              
5 1     1   9 use Carp qw/confess/;
  1         2  
  1         69  
6 1     1   7 use base 'Test2::Require';
  1         2  
  1         452  
7              
8             our $VERSION = '0.000156';
9              
10             sub skip {
11 3     3 0 205 my $class = shift;
12 3         9 my ($var) = @_;
13 3 100       302 confess "no environment variable specified" unless $var;
14 2 100       11 return undef if $ENV{$var};
15 1         10 return "This test only runs if the \$$var environment variable is set";
16             }
17              
18             1;
19              
20             __END__