File: status.t

package info (click to toggle)
libplack-app-proxy-perl 0.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 256 kB
  • sloc: perl: 1,897; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use Test::More;
use Plack::App::Proxy;
use Plack::App::Proxy::Test;
use Plack::Middleware::Lint;

test_proxy(
  proxy => sub { Plack::Middleware::Lint->wrap(
    Plack::App::Proxy->new(remote => "http://$_[0]:$_[1]")
  )},
  app   => sub {
    return [ 200, ["Content-Type", "text/plain", "Status", "200 OK"], [ "Hi" ]];
  },
  client => sub {
    my $cb = shift;
    my $req = HTTP::Request->new(GET => "http://localhost/");
    my $res = $cb->($req);
    ok $res->is_success;
  },
);

done_testing;