[Bast-commits] r4678 - trunk/DBIx-Class-Journal/t

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Wed Jul 30 04:55:30 BST 2008


Author: nothingmuch
Date: 2008-07-30 04:55:29 +0100 (Wed, 30 Jul 2008)
New Revision: 4678

Modified:
   trunk/DBIx-Class-Journal/t/01test.t
Log:
update test for fatal current_changeset outside of txn_do

Modified: trunk/DBIx-Class-Journal/t/01test.t
===================================================================
--- trunk/DBIx-Class-Journal/t/01test.t	2008-07-30 03:54:19 UTC (rev 4677)
+++ trunk/DBIx-Class-Journal/t/01test.t	2008-07-30 03:55:29 UTC (rev 4678)
@@ -10,7 +10,7 @@
     eval "use DBD::SQLite";
     plan $@
         ? ( skip_all => 'needs DBD::SQLite for testing' )
-        : ( tests => 15 );
+        : ( tests => 16 );
 }
 
 my $schema = DBICTest->init_schema(no_populate => 1);
@@ -22,7 +22,7 @@
 
 my $artist;
 my $new_cd = $schema->txn_do( sub {
-    my $current_changeset = $schema->_journal_schema->current_changeset;
+    my $current_changeset = $schema->_journal_schema->_current_changeset;
     ok( $current_changeset, "have a current changeset" );
 
     $artist = $schema->resultset('Artist')->create({
@@ -30,7 +30,7 @@
     });
 
     $schema->txn_do(sub {
-        is( $current_changeset, $schema->_journal_schema->current_changeset, "nested txn doesn't create a new changeset" );
+        is( $current_changeset, $schema->_journal_schema->_current_changeset, "nested txn doesn't create a new changeset" );
         return $schema->resultset('CD')->create({
             title => 'Angry young man',
             artist => $artist,
@@ -40,7 +40,9 @@
 });
 isa_ok($new_cd, 'DBIx::Class::Journal', 'Created CD object');
 
-is( $schema->_journal_schema->current_changeset, undef, "no current changeset" );
+is( $schema->_journal_schema->_current_changeset, undef, "no current changeset" );
+eval { $schema->_journal_schema->current_changeset };
+ok( $@, "causes error" );
 
 my $search = $schema->_journal_schema->resultset('CDAuditLog')->search();
 ok($search->count, 'Created an entry in the CD audit log');




More information about the Bast-commits mailing list