Nephia

 view release on metacpan or  search on metacpan

t/psgi/010_incognito.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use Nephia::Incognito;
use Plack::Test;
use HTTP::Request::Common;

Nephia::Incognito->incognito(
    app => sub {
        my $name = param('name') || 'tonkichi';
        [200,[],"Hello, $name"];
    },
);

my $v = Nephia::Incognito->unmask;
my $app = $v->run;

subtest default => sub {
    test_psgi $app, sub {
        my $cb  = shift;
        my $res = $cb->(GET '/');
        is $res->content, 'Hello, tonkichi';
        $res = $cb->(GET '/?name=ytnobody');
        is $res->content, 'Hello, ytnobody';
    };
};

done_testing;



( run in 1.556 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )