view release on metacpan or search on metacpan
"AnyEvent::Socket" : "0",
"App::Prove" : "0",
"App::cpanminus" : "0",
"Crypt::Rijndael" : "0",
"DBD::SQLite" : "0",
"File::Which" : "0",
"File::pushd" : "0",
"Furl" : "0",
"HTML::StickyQuery" : "0",
"HTTP::MobileAgent" : "0",
"HTTP::Request::Common" : "0",
"HTTP::Session::Store::OnMemory" : "0",
"Module::Find" : "0",
"Module::Functions" : "0",
"Plack::Builder" : "0",
"Plack::Middleware::Lint" : "0",
"Plack::Middleware::ReverseProxy" : "0",
"Plack::Middleware::Session" : "0",
"Plack::Test" : "0",
"Router::Simple::Sinatraish" : "0",
"Starlet" : "0",
suggests 'Protocol::WebSocket::Handshake::Server';
on test => sub {
requires 'Test::More', '0.98';
requires 'Test::Requires', '0.06';
suggests 'File::pushd';
suggests 'AnyEvent';
suggests 'AnyEvent::Socket';
suggests 'App::Prove';
suggests 'HTTP::Request::Common';
suggests 'HTTP::Session::Store::OnMemory';
suggests 'Plack::Builder';
suggests 'Plack::Middleware::Lint';
suggests 'Plack::Middleware::Session';
suggests 'Plack::Test';
suggests 'Test::TCP';
suggests 'Tiffany';
suggests 'Twiggy::Server';
suggests 'Test::WWW::Mechanize';
suggests 'App::cpanminus';
eg/Hello/t/01_root.t view on Meta::CPAN
use warnings;
use Plack::Test;
use Plack::Util;
use Test::More;
my $app = Plack::Util::load_psgi 'Hello.psgi';
test_psgi
app => $app,
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/');
my $res = $cb->($req);
is $res->code, 200;
diag $res->content if $res->code != 200;
};
done_testing;
eg/apps/DeepNamespace/t/01_root.t view on Meta::CPAN
use warnings;
use Plack::Test;
use Plack::Util;
use Test::More;
my $app = Plack::Util::load_psgi 'DeepNamespace.psgi';
test_psgi
app => $app,
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/');
my $res = $cb->($req);
is $res->code, 200;
diag $res->content if $res->code != 200;
};
done_testing;
eg/apps/Extended/t/01_root.t view on Meta::CPAN
use warnings;
use Plack::Test;
use Plack::Util;
use Test::More;
my $app = Plack::Util::load_psgi 'Extended.psgi';
test_psgi
app => $app,
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/', [
'User-Agent' => 'DoCoMo/1.0/P502i/c10',
]);
my $res = $cb->($req);
is $res->code, 200;
like $res->content, qr/DoCoMo world!/;
};
done_testing;
eg/apps/Extended/t/02_die.t view on Meta::CPAN
use Plack::Test;
use Plack::Util;
use Test::More;
use Plack::Middleware::StackTrace;
my $app = Plack::Util::load_psgi 'Extended.psgi';
test_psgi
app => Plack::Middleware::StackTrace->wrap($app),
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/die');
my $res = do {
local *STDERR;
open *STDERR, '>', \my $out or die $!;
$cb->($req);
};
is $res->code, 500;
like $res->content, qr/OKAY/;
return;
};
share/flavor/Basic/t/03_assets.t view on Meta::CPAN
use Plack::Test;
use Plack::Util;
use Test::More;
my $app = Plack::Util::load_psgi '<% $psgi_file // "app.psgi" %>';
test_psgi
app => $app,
client => sub {
my $cb = shift;
for my $fname (qw(static/bootstrap/css/bootstrap.css robots.txt)) {
my $req = HTTP::Request->new(GET => "http://localhost/$fname");
my $res = $cb->($req);
is($res->code, 200, $fname) or diag $res->content;
}
};
done_testing;
share/flavor/Large/t/04_admin.t view on Meta::CPAN
use Test::More;
my $admin = Plack::Util::load_psgi '<% $psgi_file %>';
test_psgi
app => $admin,
client => sub {
my $cb = shift;
# 401
{
my $req = HTTP::Request->new(GET => "http://localhost/");
my $res = $cb->($req);
is($res->code, 401, 'basic auth');
}
# 200
{
my $req = HTTP::Request->new(GET => "http://localhost/");
$req->authorization_basic('admin', 'admin');
my $res = $cb->($req);
is($res->code, 200, 'basic auth');
like($res->content, qr{admin});
}
};
done_testing;
share/flavor/Minimum/t/01_root.t view on Meta::CPAN
use t::Util;
use Plack::Test;
use Plack::Util;
use Test::More;
my $app = Plack::Util::load_psgi '<% $psgi_file // "app.psgi" %>';
test_psgi
app => $app,
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/');
my $res = $cb->($req);
is $res->code, 200;
diag $res->content if $res->code != 200;
};
done_testing;
t/600_plugins/012_streaming.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Plack::Util;
use Plack::Test;
use Test::More;
use HTTP::Request::Common;
$Plack::Test::Impl = "Server";
use Amon2;
{
package MyApp::Web;
use parent -norequire, qw/MyApp/;
use parent qw/Amon2::Web/;
sub dispatch {
my $c = shift;
t/600_plugins/014_streaming_header_splitting.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Plack::Util;
use Plack::Test;
use Test::More;
use HTTP::Request::Common;
use Test::Requires 'Test::WWW::Mechanize::PSGI';
$Plack::Test::Impl = "Server";
use Amon2;
{
package MyApp::Web;
use parent -norequire, qw/MyApp/;
use parent qw/Amon2::Web/;
sub dispatch {
t/800_dispatcher/004_router_boom.t view on Meta::CPAN
delete_ '/', 'Root#remove_index';
get '/my/foo', 'My#foo';
get '/blog/{year}/{month}', 'Blog#monthly';
get '/account/login', 'Account#login';
}
my $app = MyApp::Web->to_app();
sub Test::WWW::Mechanize::PSGI::delete_ok {
my ($self, $url) = @_;
my $request = HTTP::Request->new(DELETE => $url);
my $res = $self->request($request);
::ok($res->code =~ /\A2..\z/, "DELETE $url");
}
my $mech = Test::WWW::Mechanize::PSGI->new(app => $app);
$mech->get_ok('/');
$mech->content_is('top');
$mech->post_ok('/');
$mech->content_is('post_top');
$mech->put_ok('/');
t/800_dispatcher/004_router_boom_sinatraish.t view on Meta::CPAN
$c->create_response(200, [], "blog: $captured->{year}, $captured->{month}")
};
get '/account/login', sub {
my ($c, $captured) = @_;
$c->create_response(200, [], 'login');
};
}
sub Test::WWW::Mechanize::PSGI::delete_ok {
my ($self, $url) = @_;
my $request = HTTP::Request->new(DELETE => $url);
my $res = $self->request($request);
::ok($res->code =~ /\A2..\z/, "DELETE $url");
}
my $app = MyApp::Web->to_app();
my $mech = Test::WWW::Mechanize::PSGI->new(app => $app);
$mech->get_ok('/');
$mech->content_is('top');
$mech->head_ok('/');