X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbloggery.t;h=8aa35f6c4bbbfa20f658afdb2272c56e122fd979;hb=73349c50e6a2ecda84a6bf290ab055db6c0818a8;hp=3752074d519a27012df391c6417bce5a81533c52;hpb=957088cdb876496d4e72bfb5913a065e96b69b19;p=catagits%2FWeb-Simple.git diff --git a/t/bloggery.t b/t/bloggery.t index 3752074..8aa35f6 100644 --- a/t/bloggery.t +++ b/t/bloggery.t @@ -1,11 +1,17 @@ use strict; use warnings FATAL => 'all'; -use Test::More ( - eval { require HTTP::Request::AsCGI } - ? 'no_plan' - : (skip_all => 'No HTTP::Request::AsCGI') -); - + +use Test::More qw(no_plan); + +require_ok 'examples/bloggery/bloggery.cgi'; + +__END__ +#use Test::More ( +# eval { require HTTP::Request::AsCGI } +# ? 'no_plan' +## : (skip_all => 'No HTTP::Request::AsCGI') +#); +use HTTP::Request::AsCGI; use HTTP::Request::Common qw(GET POST); @@ -17,7 +23,7 @@ my $app = Bloggery->new( sub run_request { my $request = shift; - my $c = HTTP::Request::AsCGI->new($request)->setup; + my $c = HTTP::Request::AsCGI->new($request, SCRIPT_NAME=> $0)->setup; $app->run; $c->restore; return $c->response; @@ -25,9 +31,9 @@ sub run_request { my $res; -$res = run_request(GET 'http://localhost/index.html'); +warn run_request(GET 'http://localhost/index.html')->as_string; -warn $res->as_string; +warn run_request(GET 'http://localhost/')->as_string; warn run_request(GET 'http://localhost/One-Post.html')->as_string;