lib/WWW/Mechanize/Script/Plugin/StatusTest.pm

filter: Statementstmt 90.0% 18 / 20 Branchbran 50.0% 1 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 81.8% 27 / 33 CC 3 SCAR 7.8
CC
3
Cov
79%
check_response
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« lib/WWW/Mechanize/Script.pm ↑ Summary script/check_web2.pl »
1 package WWW::Mechanize::Script::Plugin::StatusTest;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use parent qw(WWW::Mechanize::Script::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: prove expected HTTP status of the response
9  
10 2 our $VERSION = '0.100';
11  
12 2 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 sub check_value_names
16 5 ▶{
Subroutine check_value_names: called CC=1 SCAR=0.0
Pod documented
17 5 return qw(response);
18 }
19  
20  
21 sub check_response
22 1 ▶{
Subroutine check_response: called CC=3 SCAR=14.2
Pod documented
23 1 my ( $self, $check, $mech ) = @_;
24  
25 1 my $response_code = 0 + $self->get_check_value( $check, "response" );
26  
27 1 ▶ if ( $response_code != $mech->status() )
Branch: 1 branch
BranchTrueFalseTotal
if ($response_code != $mech->status) 0 1 1
28 {
29 0 ▶ my $err_code = $self->get_check_value( $check, "response_code" ) // 1;
Condition0%0/2
$self->get_check_value($check, "response_code") // 1
l!l
00
MC/DC0%0/1
$self->get_check_value($check, "response_code") // 1
$self->get_check_value($check, "response_code")
Truth table0%0/2
A
A= $self->get_check_value($check, "response_code")
Aresult
11
00
30 0 return ( $err_code, "response code " . $mech->status() . " != $response_code" );
31 }
32  
33 1 return (0);
34 }
35  
36 2 1;
37  
38 __END__
« lib/WWW/Mechanize/Script.pm ↑ Summary script/check_web2.pl »