File Coverage

t/PerlySense-project-config.t
Criterion Covered Total %
statement 43 43 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 51 51 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   129445 use strict;
  1         3  
  1         65  
3              
4 1     1   518 use Test::More tests => 7;
  1         14663  
  1         7  
5 1     1   623 use Test::Exception;
  1         2934  
  1         4  
6              
7 1     1   600 use Data::Dumper;
  1         6032  
  1         45  
8              
9 1     1   283 use lib "../lib";
  1         512  
  1         4  
10              
11 1     1   70616 use_ok("Devel::PerlySense::Project");
  1         427  
  1         1359194  
  1         2  
  1         9  
12 1     1   840 use_ok("Devel::PerlySense::Project::Unknown");
  1         85  
  1         1  
  1         2  
  1         8  
13 1     1   285 use_ok("Devel::PerlySense");
  1         58  
  1         2  
  1         1  
  1         11  
14              
15              
16              
17              
18              
19 1         190 ok(
20             my $oPerlySense = Devel::PerlySense->new(),
21             "New PerlySense object ok",
22             );
23              
24              
25 1         353 note("No project -- default config");
26             # Don't look at the entire config, it's bound to change rapidly.
27 1         45 is_deeply(
28             $oPerlySense->rhConfig->{project},
29             {
30             moniker => "The Project Without a Name",
31             inc_dir => [ ],
32             },
33             "The default config looks right",
34             );
35              
36              
37              
38              
39              
40 1         656 note("Look for a .PerlySenseProject indicate a project");
41             {
42              
43 1         36 my $dirBase = "t/data/project/with-perlysenseproject";
  1         2  
44 1         1 my $dirProject = "$dirBase/source";
45              
46 1         2 my $rexDirProject = $dirProject;
47 1         4 $rexDirProject =~ s|\W|.|g;
48              
49 1         20 my $dirTest = "$dirProject/bogus/lib/Game";
50 1         2 my $fileTest = "$dirTest/Lawn.pm";
51              
52 1         5 ok($oPerlySense->setFindProject(file => $fileTest), "Set project ok");
53              
54 1         5342 is_deeply(
55             $oPerlySense->rhConfig->{project},
56             {
57             moniker => "Worm Game",
58             inc_dir => [
59             "glib/perl5lib",
60             "deps/perl5lib",
61             "../../with-dir/source/lib",
62             ],
63             },
64             "The project config looks right",
65             );
66              
67             }
68              
69              
70              
71              
72              
73             __END__