File Coverage

blib/lib/PDF/Writer/mock.pm
Criterion Covered Total %
statement 10 15 66.6
branch n/a
condition n/a
subroutine 4 7 57.1
pod 0 3 0.0
total 14 25 56.0


line stmt bran cond sub pod time code
1             package PDF::Writer::mock;
2              
3 1     1   8 use strict;
  1         1  
  1         46  
4 1     1   6 use warnings;
  1         2  
  1         158  
5              
6             our $VERSION = '0.03';
7              
8             our @mock;
9              
10             my @methods = qw(
11             open close save
12             begin_page end_page
13             open_image close_image
14             image_height image_width place_image
15             save_state restore_state
16             font font_size find_font
17             show_boxed show_xy
18             circle rect
19             color
20             move
21             linewidth line
22             fill stroke fill_stroke
23             stringify
24             parameter info
25             add_weblink add_bookmark
26             );
27              
28             my $x;
29             sub new {
30 1     1 0 5 return bless \$x, shift;
31             }
32              
33             foreach my $method (@methods) {
34 1     1   5 no strict 'refs';
  1         2  
  1         134  
35             *$method = sub {
36 0     0     my $self = shift;
37 0           push @mock, [ $method, @_ ];
38 0           return 1;
39             };
40             }
41              
42 0     0 0   sub mock_reset { @mock = (); }
43 0     0 0   sub mock_retrieve { @mock }
44              
45             1;
46             __END__