Skip to content

Commit

Permalink
Ported hello.t from Plack::Test to P::T::Agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Sep 22, 2011
1 parent a8f6488 commit d0ab4cb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/hello.t
@@ -0,0 +1,21 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use Plack::Test::Agent;

my $app = sub
{
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ];
};

my $agent = Plack::Test::Agent->new( app => $app );
my $res = $agent->get( 'http://localhost/hello' );
is $res->content, 'Hello World';
is $res->content_type, 'text/plain';
is $res->code, 200;
is $res->header( 'Server' ), undef, '... should default to MockHTTP server';

done_testing;

0 comments on commit d0ab4cb

Please sign in to comment.