Data/Riak/Request/Ping.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 33 CC 2 SCAR 11.5
CC
2
Cov
0%
_mangle_retval
6.0
as_http_request_args
2.0
_build_http_exception_classes
2.0
CRAP 3.1
1 package Data::Riak::Request::Ping;
2 {
3 $Data::Riak::Request::Ping::VERSION = '2.0';
4 }
5  
6 use Moose;
7 use Data::Riak::Result::SingleValue;
8 use namespace::autoclean;
9  
10 sub as_http_request_args {
11 my ($self) = @_;
12  
13 return {
14 method => 'GET',
15 uri => 'ping',
16 };
17 }
18  
19 sub _build_http_exception_classes {
20 return {
21 # This is a bit of a hack. Maybe we want to allow predicate functions to
22 # be provided, or at least regexen or some such.
23 (map { ($_ => undef) } 500 .. 599),
24 };
25 }
26  
27 sub _mangle_retval {
28 my ($self, $res) = @_;
29 $res->status_code == 200 ? 1 : 0
30 }
31  
32 with 'Data::Riak::Request',
33 'Data::Riak::Request::WithHTTPExceptionHandling';
34  
35 has '+result_class' => (
36 default => Data::Riak::Result::SingleValue::,
37 );
38  
39 __PACKAGE__->meta->make_immutable;
40  
41 1;
42  
43 __END__