File: Plugin.pm

package info (click to toggle)
libtest-mockfile-perl 0.037-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: perl: 4,110; makefile: 7
file content (67 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package Test::MockFile::Plugin;

use strict;
use warnings;

use Carp qw(croak);
require Test::MockFile;    # load Test::MockFile without setting the strict mode

our $VERSION = '0.037';

sub new {
    my ( $class, %opts ) = @_;

    my $self = bless {%opts}, $class;
    return $self;
}

sub register {
    my ($self) = @_;

    croak('Method "register" not implemented by plugin');
}

1;

=encoding utf8

=head1 NAME

Test::MockFile::Plugin - Plugin base class

=head1 SYNOPSIS

  package Test::MockFile::Plugin::YourCustomPlugin;

  use base 'Test::MockFile::Plugin';

  sub register {

    my ( $self ) = @_;

    # Code to setup your plugin here
    ...
  }

=head1 DESCRIPTION

L<Test::MockFile::Plugin> is an abstract base class for L<Test::MockFile> plugins.

=head1 METHODS

=head2 new( %opts )

Constructor provided to all Plugin packages so they have a location to store
their internal data.

=head2 register

  $plugin->register();

This method will be called by L<Test::MockFile::Plugins> on imports.

=head1 SEE ALSO

L<Test::MockFile>

=cut