Fix reconnect tests to skip tests that won't pass (when run as root, or under windows).
Adam Herzog [Tue, 7 Aug 2007 15:26:32 +0000 (15:26 +0000)]
t/33storage_reconnect.t

index f069ef0..8dcaeec 100644 (file)
@@ -49,11 +49,15 @@ ok( $@, 'The operation failed' );
 unlink($db_orig);
 move( $db_tmp, $db_orig );
 
-### Try the operation again... this time, it should succeed
-my @art_four;
-eval {
-    @art_four = $schema->resultset("Artist")->search( {}, { order_by => 'name DESC' } );
-};
-ok( !$@, 'The operation succedded' );
-cmp_ok( @art_four, '==', 3, "Three artists returned" );
-
+SKIP: {
+    skip "Cannot reconnect if original connection didn't fail", 2
+        if ( $@ =~ /encrypted or is not a database/ );
+
+    ### Try the operation again... this time, it should succeed
+    my @art_four;
+    eval {
+        @art_four = $schema->resultset("Artist")->search( {}, { order_by => 'name DESC' } );
+    };
+    ok( !$@, 'The operation succeeded' );
+    cmp_ok( @art_four, '==', 3, "Three artists returned" );
+}