resolve test directory
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Jun 2008 17:47:14 +0000 (17:47 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Jun 2008 17:55:56 +0000 (17:55 +0000)
File::Spec->tmpdir may return a symlink as well, so
c41c902ca6fd9f8e352267be64d (test in directories provided by Test::Spec)
still didn't fix darwin (in all cases).

The darwin I tested on gave a tmpdir like:
/var/folders/OJ/OJjGh2I+HBOinZB8Re8QVU+++TI/-Tmp-
but cpantesters machines are still using a symlinked /tmp.

Use Cwd to find the real path name, hopefully fixing all remaining cases.

t/50-cgi.t

index fec88e390c31bbb291e114259a09dbdbf9aedc6d..d30bff2411fb5128561bff228e0a6d619a654e1d 100644 (file)
@@ -1,6 +1,7 @@
 use strict;
 use warnings;
 
+use Cwd;
 use File::Spec;
 use Test::More;
 
@@ -14,7 +15,7 @@ require_ok('PLP::Backend::CGI') or BAIL_OUT();
 $PLP::use_cache = 0 if $PLP::use_cache;
 #TODO: caching on (change file names)
 
-my $base = File::Spec->tmpdir || File::Spec->curdir;
+my $base = Cwd::abs_path(File::Spec->tmpdir || File::Spec->curdir);
 -w $base or BAIL_OUT("$base not writable");
 my $testfile = 'testfile.plp';
 not -f "$base/$testfile" or BAIL_OUT("$testfile exists");