Index: t/16-live_cgi.t
===================================================================
RCS file: /cvsroot/mason/mason/dist/t/16-live_cgi.t,v
retrieving revision 1.24
diff -u -r1.24 16-live_cgi.t
--- t/16-live_cgi.t	17 Aug 2005 20:02:57 -0000	1.24
+++ t/16-live_cgi.t	4 Sep 2007 01:01:49 -0000
@@ -1,20 +1,36 @@
 #!/usr/bin/perl -w
 
 use strict;
-
+use File::Spec;
+use lib 'blib', File::Spec->catdir('t', 'lib');
 use Module::Build;
+use HTML::Mason::Tests;
+use Test::More;
+use vars qw($VERBOSE $DEBUG);
+use Apache::test qw(skip_test have_httpd have_module);
+
 
 my $test_data = Module::Build->current->notes('test_data');
 
-unless ($test_data->{is_maintainer} &&
-        $test_data->{apache_dir} &&
-        -e "$test_data->{apache_dir}/CGIHandler.cgi")
-{
-    print "1..0\n";
-    exit;
+my $cgi_handler;
+
+if( exists $test_data->{apache_dir} &&
+    $test_data->{apache_dir} &&
+    -d $test_data->{apache_dir}
+  ){
+  $cgi_handler = File::Spec->catfile($test_data->{apache_dir},
+                                     'CGIHandler.cgi'
+                                    );
+}else{
+  plan skip_all => '$test_data->{apache_dir} is not a directory';
 }
 
-use vars qw($VERBOSE $DEBUG);
+unless ($test_data->{is_maintainer} &&
+        -e $cgi_handler) {
+  plan skip_all => ( '$test_data->{is_maintainer} is not true or ' .
+                     'no CGIHandler.cgi within $test_data->{apache_dir}'
+                   );
+}
 
 BEGIN
 {
@@ -22,16 +38,9 @@
     $DEBUG = $ENV{MASON_DEBUG};
 }
 
-use File::Spec;
-use HTML::Mason::Tests;
-use Test;
-
-use lib 'lib', File::Spec->catdir('t', 'lib');
-
 require File::Spec->catfile( 't', 'live_server_lib.pl' );
 
-use Apache::test qw(skip_test have_httpd have_module);
-skip_test unless have_httpd;
+plan skip_all => 'have_httpd evaluates false.' unless have_httpd;
 
 # needed for Apache::test->fetch to work
 local $ENV{PORT} = $test_data->{port};
