Dancer2-Plugin-Redis
view release on metacpan or search on metacpan
sub psgi_request_ok {
my ( $app, $method, $uri, $expected_response ) = @_;
my $client = sub {
my ($cb) = @_;
my $req = HTTP::Request->new( $method => "http://localhost$uri" );
my $res = $cb->($req);
subtest "$method $uri" => sub {
plan tests => $expected_response ? 2 : 1;
ok( $res->is_success, "request successful for $method $uri" );
like( $res->decoded_content, $expected_response, "expected response content for $method $uri" )
if $expected_response;
};
return;
};
test_psgi( $app, $client );
return;
}
############################################################################
1;
( run in 2.753 seconds using v1.01-cache-2.11-cpan-26ccb49234f )