Resolve $rsrc instance duality on metadata traversal
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest.pm
index e4768a0..b43d4bf 100644 (file)
@@ -20,8 +20,8 @@ BEGIN {
   # prove) but I do not know it offhand, especially on older environments
   # Go with the safer option
   if ($INC{'Test/Builder.pm'}) {
-    local $| = 1;
-    print "#\n";
+    select( ( select(\*STDOUT), $|=1 )[0] );
+    print STDOUT "#\n";
   }
 }
 
@@ -349,8 +349,11 @@ sub init_schema {
     my $schema;
 
     if (
-      $ENV{DBICTEST_VIA_REPLICATED} &&=
-        ( !$args{storage_type} && !defined $args{sqlite_use_file} )
+      $ENV{DBICTEST_VIA_REPLICATED} &&= (
+        !$args{storage_type}
+          &&
+        ( ! defined $args{sqlite_use_file} or $args{sqlite_use_file} )
+      )
     ) {
       $args{storage_type} = ['::DBI::Replicated', { balancer_type => '::Random' }];
       $args{sqlite_use_file} = 1;