File Coverage

t/PerlySense-Document-Meta-method.t
Criterion Covered Total %
statement 53 53 100.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod n/a
total 65 66 98.4


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   191641 use strict;
  1         2  
  1         69  
3              
4 1     1   538 use Test::More tests => 15;
  1         47581  
  1         9  
5 1     1   735 use Test::Exception;
  1         8200  
  1         6  
6              
7 1     1   817 use Data::Dumper;
  1         11751  
  1         74  
8 1     1   6 use File::Basename;
  1         1  
  1         83  
9 1     1   381 use File::Spec::Functions;
  1         508  
  1         62  
10              
11 1     1   280 use lib "../lib";
  1         544  
  1         3  
12              
13 1     1   120387 use_ok("Devel::PerlySense");
  1         636  
  1         2  
  1         2  
  1         5  
14 1     1   274 use_ok("Devel::PerlySense::Document");
  1         76  
  1         1  
  1         1  
  1         7  
15 1     1   405 use_ok("Devel::PerlySense::Document::Meta");
  1         60  
  1         2  
  1         1  
  1         8  
16              
17              
18 1 50   1   2181 BEGIN { -d "t" and chdir("t"); }
19              
20              
21 1         190 ok(my $oDocument = Devel::PerlySense::Document->new(oPerlySense => Devel::PerlySense->new()), "new ok");
22              
23              
24 1         228 my $dirData = "data/project-lib";
25 1         3 my $fileOrigin = "$dirData/Game/Object/Worm.pm";
26              
27 1         3 ok($oDocument->parse(file => $fileOrigin), "Parsed file ok");
28              
29 1         441 my $oMeta = $oDocument->oMeta;
30              
31 1         4 is(scalar(keys %{$oMeta->rhRowColMethod}), 31, " found correct number of methods");
  1         24  
32              
33 1         220 is($oMeta->rhRowColMethod->{126}->{30}->{oNode} . "", "raBodyLocation", " got method");
34 1         218 is($oMeta->rhRowColMethod->{126}->{30}->{oNodeObject} . "", '$self', " got method invocant");
35              
36 1         213 is($oMeta->rhRowColMethod->{149}->{22}->{oNode} . "", "SUPER::new", " got super method");
37 1         210 is($oMeta->rhRowColMethod->{149}->{22}->{oNodeObject} . "", '$pkg', " got method invocant");
38              
39 1         209 is($oMeta->rhRowColMethod->{149}->{50}->{oNode} . "", "new", " got nested method");
40 1         210 is($oMeta->rhRowColMethod->{149}->{50}->{oNodeObject} . "", 'Game::Location', " got module invocant");
41              
42 1         211 is($oMeta->rhRowColMethod->{259}->{31}->{oNode} . "", "direction", " got chained method");
43 1         213 is($oMeta->rhRowColMethod->{259}->{31}->{oNodeObject} . "", 'oDirection', " got method invocant");
44              
45              
46              
47              
48              
49 1         209 is($oMeta->rhRowColMethod->{126}->{25}, undef, " no module at self");
50              
51             #print join(", ", keys %{$oMeta->rhRowColMethod}) . "\n";
52              
53              
54              
55             __END__