Clarify travis timings
[dbsrgits/DBIx-Class.git] / t / storage / txn_scope_guard.t
index 03985b3..c0cb347 100644 (file)
@@ -24,7 +24,7 @@ use DBICTest;
     });
 
    $guard->commit;
-  } qr/No such column made_up_column .*? at .*?\Q$fn\E line \d+/s, "Error propogated okay";
+  } qr/No such column 'made_up_column' .*? at .*?\Q$fn\E line \d+/s, "Error propogated okay";
 
   ok(!$artist_rs->find({name => 'Death Cab for Cutie'}), "Artist not created");
 
@@ -116,7 +116,9 @@ use DBICTest;
 }
 
 # make sure it warns *big* on failed rollbacks
-{
+# test with and without a poisoned $@
+for my $poison (0,1) {
+
   my $schema = DBICTest->init_schema();
 
   no strict 'refs';
@@ -160,11 +162,12 @@ use DBICTest;
     }
   };
   {
+      eval { die 'GIFT!' if $poison };
       my $guard = $schema->txn_scope_guard;
       $schema->resultset ('Artist')->create ({ name => 'bohhoo'});
   }
 
-  is (@w, 2, 'Both expected warnings found');
+  is (@w, 2, 'Both expected warnings found' . ($poison ? ' (after $@ poisoning)' : '') );
 
   # just to mask off warning since we could not disconnect above
   $schema->storage->_dbh->disconnect;