Permalink
Browse files

Ported hello.t from Plack::Test to P::T::Agent.

  • Loading branch information...
1 parent a8f6488 commit d0ab4cb2ccb594875e3967b1e90872d43c14fb65 @chromatic committed Sep 22, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 t/hello.t
View
21 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.