File Coverage

t/PerlySense-Document-Meta-pod.t
Criterion Covered Total %
statement 66 66 100.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod n/a
total 78 79 98.7


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   116608 use strict;
  1         2  
  1         73  
3              
4 1     1   493 use Test::More tests => 27;
  1         18892  
  1         11  
5 1     1   1308 use Test::Exception;
  1         2883  
  1         6  
6              
7 1     1   765 use Data::Dumper;
  1         7064  
  1         77  
8 1     1   8 use File::Basename;
  1         1  
  1         91  
9 1     1   402 use File::Spec::Functions;
  1         496  
  1         62  
10              
11 1     1   333 use lib "../lib";
  1         545  
  1         4  
12              
13 1     1   133929 use_ok("Devel::PerlySense");
  1         619  
  1         2  
  1         1  
  1         6  
14 1     1   273 use_ok("Devel::PerlySense::Document");
  1         88  
  1         2  
  1         1  
  1         7  
15 1     1   193 use_ok("Devel::PerlySense::Document::Meta");
  1         55  
  1         185  
  1         1  
  1         16  
16              
17              
18 1 50   1   4471 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         186 my $dirData = "data/simple-lib";
25 1         2 my $fileOrigin = "$dirData/lib/Win32/Word/Writer.pm";
26              
27 1         4 ok($oDocument->parse(file => $fileOrigin), "Parsed file ok");
28              
29 1         321 my $oMeta = $oDocument->oMeta;
30              
31 1         3 is(scalar(@{$oMeta->raLocationPod}), 69 + 7, " Correct number of pod chunks found");
  1         24  
32              
33 1         188 my $oLocation;
34              
35 1         26 ok($oLocation = $oMeta->raLocationPod->[3], "Got a POD chunk (head1 inside pod)");
36 1         416 is($oLocation->row, 106, " row");
37 1         210 is($oLocation->col, 1, " col");
38 1         210 is($oLocation->rhProperty->{podSection},
39             q{},
40             " pod");
41 1         415 is($oLocation->rhProperty->{pod},
42             q{=head1 CONCEPTS
43              
44             Win32::Word::Writer uses an OLE instance of Word to create Word
45             documents.
46              
47             The documents are constructed in a linear fashion, i.e. you add text
48             to the document and generally don't move around the document a lot.
49              
50              
51             },
52             " pod");
53              
54              
55              
56 1         211 ok($oLocation = $oMeta->raLocationPod->[5], "Got a POD chunk (head1 at beginning of pod)");
57 1         214 is($oLocation->row, 168, " row");
58 1         210 is($oLocation->rhProperty->{podSection},
59             q{},
60             " pod");
61 1         208 is($oLocation->rhProperty->{pod},
62             q{=head1 PROPERTIES
63              
64             },
65             " pod");
66              
67              
68              
69 1         210 ok($oLocation = $oMeta->raLocationPod->[7], "Got a POD chunk (head2 inside pod)");
70 1         427 is($oLocation->row, 175, " row");
71 1         474 is($oLocation->rhProperty->{podSection},
72             q{=head1 PROPERTIES
73              
74             },
75             " pod");
76 1         212 is($oLocation->rhProperty->{pod},
77             q{=head2 oDocument
78              
79             A Win32::OLE object with the Application's Document object. Often used
80             shorthand.
81              
82              
83             },
84             " pod");
85              
86              
87              
88 1         210 ok($oLocation = $oMeta->raLocationPod->[16], "Got a POD chunk (head2 first)");
89 1         210 is($oLocation->row, 365, " row");
90 1         210 is($oLocation->rhProperty->{podSection},
91             q{=head1 METHODS
92              
93             },
94             " pod");
95 1         209 is($oLocation->rhProperty->{pod},
96             q{=head2 Close()
97              
98             Discard the current document no-questions-asked (i.e. even if it's not
99             saved).
100              
101             Note that this object is in an unusable state until a new document is
102             created or opened.
103              
104             },
105             " pod");
106              
107              
108              
109 1         208 ok($oLocation = $oMeta->raLocationPod->[48], "Got a POD chunk (head2 first)");
110 1         211 is($oLocation->row, 981, " row");
111 1         215 is($oLocation->rhProperty->{podSection},
112             q{=head1 METHODS - UTILITY
113              
114             },
115             " pod");
116 1         208 is($oLocation->rhProperty->{pod},
117             q{=item MarkDocumentAsSaved()
118              
119             Mark the Word document as "saved". This is in effect until
120             the document is changed again.
121              
122             Being saved e.g. means it can be abandoned without
123             questions.
124              
125             Return 1 on success, else die.
126              
127             },
128             " pod");
129              
130              
131              
132              
133              
134              
135              
136             #print Dumper($oMeta);
137              
138              
139              
140             __END__