File Coverage

blib/lib/Jifty/Test/Dist.pm
Criterion Covered Total %
statement 22 22 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod n/a
total 29 30 96.6


line stmt bran cond sub pod time code
1             package Jifty::Test::Dist;
2              
3 90     90   518147 use FindBin;
  90         137978  
  90         3973  
4 90     90   622 use File::Spec;
  90         160  
  90         1850  
5 90     90   419 use Cwd;
  90         156  
  90         14767  
6              
7             our @post_chdir;
8              
9             BEGIN {
10 90     90   503835 $Jifty::Test::Dist::OrigCwd = Cwd::cwd;
11              
12 90 50       2304 @INC = grep { defined } map { ref($_) ? $_ : File::Spec->rel2abs($_) } @INC;
  1078         4924  
  1078         35339  
13 90         4926 chdir "$FindBin::Bin/..";
14              
15             # SetupWizard needs this to remove lingering site_config files before
16             # loading Jifty
17 90         10477 for (@post_chdir) { $_->() }
  1         21  
18             }
19              
20 90     90   129540 use lib 'lib';
  90         90149  
  90         768  
21 90     90   21582 use base qw/Jifty::Test/;
  90         303  
  90         63827  
22              
23             =head1 NAME
24              
25             Jifty::Test::Dist - Tests in Jifty distributions inside of Jifty
26              
27             =head1 SYNOPSIS
28              
29             use Jifty::Test::Dist tests => 5;
30              
31             =head1 DESCRIPTION
32              
33             Jifty::Test::Dist is a utility wrapper around L; it
34             changes the current working directory to be the one step above where
35             the test file is, so that Jifty will detect the correct application
36             root for the tests.
37              
38             =cut
39              
40             1;
41