File Coverage

blib/lib/Test/MockObject/Universal.pm
Criterion Covered Total %
statement 7 16 43.7
branch n/a
condition 0 3 0.0
subroutine 3 7 42.8
pod 3 3 100.0
total 13 29 44.8


line stmt bran cond sub pod time code
1             package Test::MockObject::Universal;
2             {
3             $Test::MockObject::Universal::VERSION = '0.11';
4             }
5             BEGIN {
6 1     1   21399 $Test::MockObject::Universal::AUTHORITY = 'cpan:TEX';
7             }
8             # ABSTRACT: a truly universal mock object
9              
10 1     1   9 use strict;
  1         2  
  1         27  
11 1     1   4 use warnings;
  1         2  
  1         119  
12              
13             sub new {
14 0     0 1   my $that = shift;
15 0   0       my $class = ref($that) || $that;
16 0           my $self = {};
17 0           bless $self, $class;
18 0           return $self;
19             }
20              
21             # DGR: the whole purpose of this class is to provide autoloading ...
22             ## no critic (ProhibitAutoloading)
23             sub AUTOLOAD {
24 0     0     my $self = shift;
25              
26 0           return ();
27             }
28             ## use critic
29              
30             sub isa {
31 0     0 1   return 1;
32             }
33              
34             sub can {
35 0     0 1   return 1;
36             }
37              
38             1;
39              
40             __END__
41              
42             =pod
43              
44             =encoding utf-8
45              
46             =head1 NAME
47              
48             Test::MockObject::Universal - a truly universal mock object
49              
50             =head1 SYNOPSIS
51              
52             my $Dummy = Test::MockObject::Universal::->new();
53             $Dummy->can('whatever you want');
54              
55             =head1 DESCRIPTION
56              
57             This class provides a very simple mock object that does not inherit from Test::MockObject.
58              
59             The goal of this module is to be as simple and fast as possible.
60              
61             If you want more functionality you should probably look at Test::MockObject.
62              
63             =head1 NAME
64              
65             Test::MockObject::Universal - A universal MockObject
66              
67             =head1 METHODS
68              
69             =head2 isa
70              
71             Always returns true.
72              
73             =head2 can
74              
75             Always returns true.
76              
77             =head2 AUTOLOAD
78              
79             AUTOLOAD is provided to always return a empty list.
80              
81             =head2 new
82              
83             Constructor. Takes no arguments.
84              
85             =cut
86              
87             =head1 AUTHOR
88              
89             Dominik Schulz <dominik.schulz@gauner.org>
90              
91             =head1 COPYRIGHT AND LICENSE
92              
93             This software is copyright (c) 2012 by Dominik Schulz.
94              
95             This is free software; you can redistribute it and/or modify it under
96             the same terms as the Perl 5 programming language system itself.
97              
98             =cut