File Coverage

t/PerlySense-smart-doc-module-method.t
Criterion Covered Total %
statement 48 48 100.0
branch 1 2 50.0
condition n/a
subroutine 10 10 100.0
pod n/a
total 59 60 98.3


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   173988 use strict;
  1         2  
  1         67  
3              
4 1     1   580 use Test::More tests => 11;
  1         53980  
  1         10  
5 1     1   844 use Test::Exception;
  1         3268  
  1         5  
6              
7 1     1   228 use File::Basename;
  1         1  
  1         98  
8 1     1   289 use File::Spec::Functions;
  1         484  
  1         59  
9 1     1   408 use Data::Dumper;
  1         8034  
  1         64  
10              
11 1     1   358 use lib "../lib";
  1         542  
  1         3  
12              
13 1     1   98839 use_ok("Devel::PerlySense");
  1         605  
  1         2  
  1         2  
  1         5  
14 1     1   275 use_ok("Devel::PerlySense::Document::Location");
  1         76  
  1         1  
  1         1  
  1         7  
15              
16              
17 1 50   1   1457 BEGIN { -d "t" and chdir("t"); }
18              
19              
20 1         197 ok(my $oPs = Devel::PerlySense->new(), "new ok");
21              
22              
23              
24 1         187 my $dirData = "data/project-lib";
25 1         3 my $fileOrigin = "$dirData/Game/Application.pm";
26 1         4 my $rexFileDest = qr/Game.Object.Worm.Bot.pm/;
27 1         1 my $text;
28 1         9 my $oLocation;
29 1         2 my $rex;
30              
31              
32 1         2 $text = q{METHODS
33             new([$left = 11], [$top = 12], [$direction = "left"], [$length = 3)
34             Create new Bot Worm, facing in $direction ("left", "right", "up", "down"
35             (only left supported right now)), with a body a total size of $length.};
36 1         4 ok($oLocation = $oPs->oLocationSmartDoc(file => $fileOrigin, row => 115, col => 45), "Found POD ok");
37 1         2180 is($oLocation->rhProperty->{text}, $text, " Found POD text ok");
38 1         640 like($oLocation->file, $rexFileDest, " In correct file");
39 1         426 is($oLocation->row, 74, " row");
40 1         353 is($oLocation->col, 1, " col");
41 1         215 is($oLocation->rhProperty->{docType}, "hint", " docType method");
42 1         214 is($oLocation->rhProperty->{found}, "method", " docType method");
43 1         210 is($oLocation->rhProperty->{name}, "new", " name");
44              
45              
46              
47              
48             __END__