Fixed up test to check to see if user has a diff program installed
Devin Austin [Wed, 27 May 2009 08:33:17 +0000 (08:33 +0000)]
t/check_testapp_the_same.t

index e48a7ab..5a0b8de 100644 (file)
@@ -5,11 +5,25 @@ use FindBin qw/$Bin/;
 
 use Test::More tests => 3;
 
+## find out where catalyst.pl is
 my $cat = `which catalyst.pl`;
 chomp($cat);
+
+## remove any existing test apps
 is system("rm -rf $Bin/../TestAppForComparison"), 0 or BAIL_OUT;
-is system("cd $Bin/../; $^X -I $Bin/../lib $cat TestAppForComparison"), 0 or BAIL_OUT;
-my $diff = `diff -urN -x .svn -x Changes $Bin/TestAppForComparison $Bin/../TestAppForComparison`;
-ok !length($diff), 'Generated same TestApp',
-    or warn($diff);
 
+## create a new test app to compare to
+is system("cd $Bin/../; $^X -I$Bin/../lib $cat TestAppForComparison"), 0 or BAIL_OUT;
+
+SKIP: {
+    my $diff;
+    eval {
+        $diff = `diff -urN -x .svn -x Changes $Bin/TestAppForComparison $Bin/../TestAppForComparison`;
+    };
+    
+    skip "no diff program installed, skipping", 1 if $@;
+    
+    ok !length($diff), 'Generated same TestApp', or warn($diff);
+    
+}