From 1d02a6b1b1c03539afd9720b567fa45d01a75b52 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Tue, 10 Aug 2010 15:09:10 +0200 Subject: reflect modifications due to new hook system in dancer --- t/01_basic.t | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 't') diff --git a/t/01_basic.t b/t/01_basic.t index 72bfcc6..dbdb70d 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -1,19 +1,17 @@ use strict; use warnings; -#use lib ('t/lib'); use Test::More tests => 2; use HTTP::Request; use LWP::UserAgent; use Plack::Loader; use Dancer::Config 'setting'; -#use TestApp; use Test::TCP; my $app = sub { - my $env = shift; + my $env = shift; my $request = Dancer::Request->new($env); Dancer->dance($request); }; @@ -21,18 +19,19 @@ my $app = sub { Test::TCP::test_tcp( client => sub { my $port = shift; - my $req = HTTP::Request->new(GET => "http://127.0.0.1:$port/"); - $req->header( 'Accept-Language' => 'fr' ); - my $ua = LWP::UserAgent->new; + my $req = HTTP::Request->new( GET => "http://127.0.0.1:$port/" ); + $req->header( 'Accept-Language' => 'fr' ); + my $ua = LWP::UserAgent->new; my $res = $ua->request($req); - like $res->content, qr/first we got bonjour/, 'french content'; - like $res->content, qr/then we have hallo/, 'german content'; + like $res->content, qr/first we got bonjour/, 'french content'; + like $res->content, qr/then we have hallo/, 'german content'; }, server => sub { use t::lib::TestApp; my $port = shift; setting apphandler => 'PSGI'; - setting template => 'template_toolkit'; + setting appname => 'TestApp'; + setting template => 'template_toolkit'; Dancer::Config->load; Plack::Loader->auto( port => $port )->run($app); } -- cgit 1.4.1