Skip to content

Instantly share code, notes, and snippets.

@s-aska
Created July 28, 2011 10:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-aska/1111320 to your computer and use it in GitHub Desktop.
Save s-aska/1111320 to your computer and use it in GitHub Desktop.
PSGI Error Test
# 500
test_psgi
app => builder {
enable "StackTrace", no_print_errors => 1; # no warning in make test.
MyApp->handler
},
client => sub {
my $cb = shift;
my $req = HTTP::Request->new( GET => 'http://localhost/foo/error' );
$req->header('Accept' => 'text/html'); # get stack trace message
my $res = $cb->( $req );
is $res->code, '500';
like $res->content, qr|\Qdie "error"\E|;
} ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment