1 package WWW
::Mechanize
::Script
::Plugin
::StatusTest
;
6 use parent
qw(WWW::Mechanize::Script::Plugin);
8 # ABSTRACT: prove expected HTTP status of the response
10 our $VERSION = '0.001_004';
14 =method check_value_names
()
25 =method check_response
(\
%check,$mech)
27 This methods proves whether the HTTP status code of the response matches the
28 value configured
in I
<response
> and accumulates I
<response_code
> into I
<$code>
31 Return the accumulated I
<$code> and appropriate constructed message
, if
38 my ( $self, $check, $mech ) = @_;
40 my $response_code = 0 + $self->get_check_value( $check, "response" );
42 if ( $response_code != $mech->status() )
44 my $err_code = $self->get_check_value( $check, "response_code" ) // 1;
45 return ( $err_code, "response code " . $mech->status() . " != $response_code" );