File Coverage

blib/lib/Test/MockFile/Plugin.pm
Criterion Covered Total %
statement 12 14 85.7
branch n/a
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 18 21 85.7


line stmt bran cond sub pod time code
1             package Test::MockFile::Plugin;
2              
3 6     6   1619 use strict;
  6         11  
  6         249  
4 6     6   29 use warnings;
  6         12  
  6         407  
5              
6 6     6   40 use Carp qw(croak);
  6         12  
  6         1322  
7             require Test::MockFile; # load Test::MockFile without setting the strict mode
8              
9             our $VERSION = '0.037';
10              
11             sub new {
12 6     6 1 20 my ( $class, %opts ) = @_;
13              
14 6         21 my $self = bless {%opts}, $class;
15 6         21 return $self;
16             }
17              
18             sub register {
19 0     0 1   my ($self) = @_;
20              
21 0           croak('Method "register" not implemented by plugin');
22             }
23              
24             1;
25              
26             =encoding utf8
27              
28             =head1 NAME
29              
30             Test::MockFile::Plugin - Plugin base class
31              
32             =head1 SYNOPSIS
33              
34             package Test::MockFile::Plugin::YourCustomPlugin;
35              
36             use base 'Test::MockFile::Plugin';
37              
38             sub register {
39              
40             my ( $self ) = @_;
41              
42             # Code to setup your plugin here
43             ...
44             }
45              
46             =head1 DESCRIPTION
47              
48             L is an abstract base class for L plugins.
49              
50             =head1 METHODS
51              
52             =head2 new( %opts )
53              
54             Constructor provided to all Plugin packages so they have a location to store
55             their internal data.
56              
57             =head2 register
58              
59             $plugin->register();
60              
61             This method will be called by L on imports.
62              
63             =head1 SEE ALSO
64              
65             L
66              
67             =cut