Factor SQL-standard deferred FK checks into a component
[dbsrgits/DBIx-Class.git] / t / 51threadtxn.t
index 1c8f7e6..a0e07bd 100644 (file)
@@ -7,6 +7,11 @@ BEGIN {
     print "1..0 # SKIP your perl does not support ithreads\n";
     exit 0;
   }
+
+  if ($INC{'Devel/Cover.pm'}) {
+    print "1..0 # SKIP Devel::Cover does not work with threads yet\n";
+    exit 0;
+  }
 }
 use threads;
 
@@ -21,6 +26,7 @@ plan skip_all => 'DBIC does not actively support threads before perl 5.8.5'
 use DBIx::Class::Optional::Dependencies ();
 use Scalar::Util 'weaken';
 use lib qw(t/lib);
+use DBICTest;
 
 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
@@ -53,7 +59,7 @@ eval {
     $schema->resultset('CD')->create({ title => 'vacation in antarctica part 2', artist => 456, year => 1901 });
 
     $parent_rs = $schema->resultset('CD')->search({ year => 1901 });
-    $parent_rs->next;
+    is ($parent_rs->count, 2);
 };
 ok(!$@) or diag "Creation eval failed: $@";