skip this test if we can't get an absolute path
authorJesse Luehrs <doy@tozt.net>
Tue, 18 Dec 2012 21:06:01 +0000 (15:06 -0600)
committerJesse Luehrs <doy@tozt.net>
Tue, 18 Dec 2012 22:30:58 +0000 (16:30 -0600)
fixes testing as root on at least solaris and openbsd

t/op/require_errors.t

index c60bc7d..e323948 100644 (file)
@@ -89,13 +89,18 @@ SKIP: {
         qr<^\QCan't locate $mod_file:>,
         "special error message if the file exists but can't be opened";
 
-    my $file = File::Spec::Functions::catfile(Cwd::getcwd(), $mod_file);
-    eval {
-        require($file);
-    };
-    like $@,
-        qr<^\QCan't locate $file:>,
-        "...even if we use a full path";
+    SKIP: {
+        skip "Can't make the path absolute", 1
+            if !defined(Cwd::getcwd());
+
+        my $file = File::Spec::Functions::catfile(Cwd::getcwd(), $mod_file);
+        eval {
+            require($file);
+        };
+        like $@,
+            qr<^\QCan't locate $file:>,
+            "...even if we use a full path";
+    }
 
     # switch uid back (may not be implemented)
     eval { $> = $olduid; };