File Coverage

blib/lib/ASP4/Mock/ClientSocket.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 4 6 66.6
pod 1 3 33.3
total 14 19 73.6


line stmt bran cond sub pod time code
1              
2             package ASP4::Mock::ClientSocket;
3              
4 9     9   28 use strict;
  9         10  
  9         205  
5 9     9   41 use warnings 'all';
  9         36  
  9         831  
6              
7             sub new {
8             return bless {
9       0     on_close => sub { },
10 5130     5130 0 24059 }, shift;
11             }
12              
13 5130     5130 0 4296 sub on_close { my $s = shift; $s->{on_close} = shift }
  5130         7237  
14 0     0 1   sub close { shift->{on_close}->( ) }
15              
16             1;# return true:
17              
18             =pod
19              
20             =head1 NAME
21              
22             ASP4::Mock::ClientSocket - Mimics APR::Socket object
23              
24             =head1 SYNOPSIS
25              
26             my $socket = $r->connection->client_socket
27              
28             =head1 DESCRIPTION
29              
30             Mimics (minimally) the L object.
31              
32             =head1 PUBLIC METHODS
33              
34             =head2 close( )
35              
36             Internal use only.
37              
38             =cut
39