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   6 use strict;
  1         2  
  1         30  
3 1     1   10 use warnings;
  1         4  
  1         33  
4              
5 1     1   5 use Carp qw/confess/;
  1         2  
  1         43  
6 1     1   8 use base 'Test2::Require';
  1         3  
  1         421  
7              
8             our $VERSION = '0.000153';
9              
10             sub skip {
11 3     3 0 207 my $class = shift;
12 3         7 my ($var) = @_;
13 3 100       299 confess "no environment variable specified" unless $var;
14 2 100       12 return undef if $ENV{$var};
15 1         52 return "This test only runs if the \$$var environment variable is set";
16             }
17              
18             1;
19              
20             __END__