missing CONTRIBUTORS entry for osfameron
[catagits/Web-Simple.git] / t / env.t
diff --git a/t/env.t b/t/env.t
index 7a97658..0045f01 100644 (file)
--- a/t/env.t
+++ b/t/env.t
@@ -1,18 +1,15 @@
 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 'no_plan';
+use Plack::Test;
 
 {
   use Web::Simple 'EnvTest';
   package EnvTest;
-  dispatch {
+  sub dispatch_request  {
     sub (GET) {
-      my $env = @_[ENV];
+      my $env = $_[PSGI_ENV];
       [ 200,
         [ "Content-type" => "text/plain" ],
         [ 'foo' ]
@@ -21,16 +18,6 @@ use Test::More (
   }
 }
 
-use HTTP::Request::Common qw(GET POST);
-
 my $app = EnvTest->new;
 
-sub run_request {
-  my $request = shift;
-  my $c = HTTP::Request::AsCGI->new($request)->setup;
-  $app->run;
-  $c->restore;
-  return $c->response;
-}
-
-run_request(GET 'http://localhost/');
+ok $app->run_test_request(GET => 'http://localhost/')->is_success;