diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-09-02 10:50:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-09-02 10:53:59 -0400 |
commit | 61fa7917ab15e46892211f712e554eaccf8857fb (patch) | |
tree | 11a089d2b76a45708bed85d4b17ab0a72761410f /t | |
parent | 39d3a137834aa90350e1947b734e003986bd5d78 (diff) | |
download | web-request-61fa7917ab15e46892211f712e554eaccf8857fb.tar.gz web-request-61fa7917ab15e46892211f712e554eaccf8857fb.zip |
add Web::Response->to_app (backported from Plack e3d0dde)
Diffstat (limited to 't')
-rw-r--r-- | t/response-to_app.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/response-to_app.t b/t/response-to_app.t new file mode 100644 index 0000000..703953d --- /dev/null +++ b/t/response-to_app.t @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Plack::Test; + +use HTTP::Request::Common; +use Web::Response; + +my $res = Web::Response->new(status => 200); +$res->content("hello"); + +test_psgi $res->to_app, sub { + my $cb = shift; + + my $res = $cb->(GET "/"); + is $res->code, 200, 'response code'; + is $res->content, 'hello', 'content'; +}; + +done_testing; |