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