line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
# $URL$ |
3
|
|
|
|
|
|
|
# $Date$ |
4
|
|
|
|
|
|
|
# $Author$ |
5
|
|
|
|
|
|
|
# $Revision$ |
6
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
7
|
|
|
|
|
|
|
package Wetware::Test::Mock; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
4963
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
65
|
|
10
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
426
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.01; |
13
|
|
|
|
|
|
|
our $AUTOLOAD; # it's a package global |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
16
|
|
|
|
|
|
|
# the Plain Vanilla form |
17
|
|
|
|
|
|
|
sub new { |
18
|
4
|
|
|
4
|
0
|
9
|
my ($class, %params) = @_; # Normalize the keys of the attributes hash to ALL_CAPS. |
19
|
4
|
|
|
|
|
8
|
my %uppercase_params = map { ( uc $_ => $params{$_} ) } keys %params; |
|
1
|
|
|
|
|
7
|
|
20
|
4
|
|
|
|
|
11
|
my $self = bless \%uppercase_params, $class; |
21
|
4
|
|
|
|
|
20
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub AUTOLOAD { |
25
|
1
|
|
|
1
|
|
10
|
my $self = shift; |
26
|
1
|
|
|
|
|
3
|
my $name = $AUTOLOAD; |
27
|
1
|
|
|
|
|
9
|
$name =~ s/.*://; # strip fully-qualified portion |
28
|
1
|
|
|
|
|
11
|
return $self->{ uc $name }; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |