Gearman/Types.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package AnyEvent::Gearman::Types;
2 use Any::Moose;
3 use Any::Moose '::Util::TypeConstraints';
4  
5 subtype 'AnyEvent::Gearman::Client::Connections'
6 => as 'ArrayRef[AnyEvent::Gearman::Client::Connection]';
7  
8 subtype 'AnyEvent::Gearman::Client::StrConnections'
9 => as 'ArrayRef[Str]';
10  
11 coerce 'AnyEvent::Gearman::Client::Connections'
12 => from 'AnyEvent::Gearman::Client::StrConnections' => via {
13 for my $con (@$_) {
14 next if ref($con) and $con->isa('AnyEvent::Gearman::Client::Connection');
15 $con = AnyEvent::Gearman::Client::Connection->new( hostspec => $con );
16 }
17 $_;
18 };
19  
20 subtype 'AnyEvent::Gearman::Worker::Connections'
21 => as 'ArrayRef[AnyEvent::Gearman::Worker::Connection]';
22  
23 subtype 'AnyEvent::Gearman::Worker::StrConnections'
24 => as 'ArrayRef[Str]';
25  
26 coerce 'AnyEvent::Gearman::Worker::Connections'
27 => from 'AnyEvent::Gearman::Worker::StrConnections' => via {
28 for my $con (@$_) {
29 next if ref($con) and $con->isa('AnyEvent::Gearman::Worker::Connection');
30 $con = AnyEvent::Gearman::Worker::Connection->new( hostspec => $con );
31 }
32 $_;
33 };
34  
35 1;
36  
37 __END__