use Test::Needs
[catagits/Web-Simple.git] / t / stream_test.t
index 38118fe..812ccda 100644 (file)
@@ -1,12 +1,8 @@
 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;
+use Test::Needs 'HTTP::Request::AsCGI';
 use HTTP::Request::Common qw(GET POST);
 
 my $app = StreamTest->new;
@@ -14,8 +10,6 @@ my $app = StreamTest->new;
 ok run_request( $app, GET 'http://localhost/' )->is_success;
 is run_request( $app, GET 'http://localhost/' )->content, "foo";
 
-done_testing;
-
 sub run_request {
     my ( $app, $request ) = @_;
     my $c = HTTP::Request::AsCGI->new( $request )->setup;
@@ -44,3 +38,5 @@ sub run_request {
         },;
     }
 }
+
+done_testing;