Permalink
Browse files

Fix condition in test to work on non-unix

It's got the full package name, you goof.
  • Loading branch information...
1 parent dac4383 commit b973755ae8a5d1871b510e0c846435e6c9fc28ae @rwstauner committed Jun 30, 2011
Showing with 9 additions and 4 deletions.
  1. +2 −0 Changes
  2. +7 −4 t/native.t
View
@@ -2,6 +2,8 @@ Revision history for File-Spec-Native
{{$NEXT}}
+ - Fix test for non-unix
+
1.001 2011-06-28T16:50:39Z
- Fix typo in Pod
View
@@ -13,10 +13,13 @@ is(File::Spec->catfile(@path), File::Spec::Native->catfile(@path), 'base == Nati
use File::Spec::Functions qw(catdir);
is(catdir(@path), File::Spec::Native->catdir(@path), 'base == Native');
-my $format = $File::Spec::ISA[0] eq 'Win32' ? 'Unix' : 'Win32';
-my $fsclass = "File::Spec::$format";
-eval "require $fsclass";
+# try to find something that isn't the current OS
+my $prefix = 'File::Spec';
+my $detected = $File::Spec::ISA[0];
+
+my $fsclass = "${prefix}::" . ($detected eq "${prefix}::Win32" ? 'Unix' : 'Win32');
+eval "require $fsclass" or die $@;
my $foreign = $fsclass->catfile(@path);
-isnt($foreign, File::Spec::Native->catfile(@path), 'foreign != native');
+isnt($foreign, File::Spec::Native->catfile(@path), "foreign ($fsclass) != native ($detected)");

0 comments on commit b973755

Please sign in to comment.