Amon2-Plugin-Web-Flash

 view release on metacpan or  search on metacpan

t/02_flash.t  view on Meta::CPAN

    __PACKAGE__->to_app;
};

sub deftest($&) {
    my ($desc, $sub) = @_;
    subtest $desc => sub {
        test_psgi(
            app => $app,
            client => sub {
                my $cb = shift;
                $cb->(HTTP::Request->new(GET => "http://localhost/session")); # set session_id
                $sub->($cb);
                done_testing;
            }
        );
    };
}

sub request {
    my ($cb, $action) = @_;

    my $res = $cb->(HTTP::Request->new(GET => "http://localhost/$action?$session_key=$session_id"));
    note $res->content;
    return $res->content;
}

##### Tests starts here ####

deftest 'set and get and turn' => sub {
    my $cb = shift;
    unlike request($cb, 'set'), qr/honey is Honey/;
    like request($cb, 'use'), qr/honey is Honey/;



( run in 0.494 second using v1.01-cache-2.11-cpan-de7293f3b23 )