line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mock::Quick::Method; |
2
|
9
|
|
|
9
|
|
208670
|
use strict; |
|
9
|
|
|
|
|
24
|
|
|
9
|
|
|
|
|
580
|
|
3
|
9
|
|
|
9
|
|
50
|
use warnings; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
360
|
|
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
49
|
use Carp (); |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
171
|
|
6
|
9
|
|
|
9
|
|
76
|
use Scalar::Util (); |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
1483
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
15
|
|
|
15
|
0
|
1654
|
my $class = shift; |
10
|
15
|
|
|
|
|
30
|
my ($sub) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Fixes #11 |
13
|
15
|
100
|
66
|
|
|
170
|
return $sub |
|
|
|
66
|
|
|
|
|
14
|
|
|
|
|
|
|
if $sub |
15
|
|
|
|
|
|
|
&& Scalar::Util::blessed($sub) |
16
|
|
|
|
|
|
|
&& $sub->isa($class); |
17
|
|
|
|
|
|
|
|
18
|
14
|
100
|
|
|
|
90
|
Carp::croak "Constructor to $class takes a single codeblock" |
19
|
|
|
|
|
|
|
unless ref $sub eq 'CODE'; |
20
|
13
|
|
|
|
|
83
|
return bless $sub, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Mock::Quick::Method - Simple method wrapper |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
See L<Mock::Quick> and L<Mock::Quick::Object> for more details. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 AUTHORS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Chad Granum L<exodist7@gmail.com> |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 COPYRIGHT |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Copyright (C) 2011 Chad Granum |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Mock-Quick is free software; Standard perl licence. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Mock-Quick is distributed in the hope that it will be useful, but WITHOUT ANY |
46
|
|
|
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
47
|
|
|
|
|
|
|
PARTICULAR PURPOSE. See the license for more details. |