Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class.git] / t / 81transactions.t
index fe3c453..4a7830f 100644 (file)
@@ -5,7 +5,7 @@ use Test::More;
 use lib qw(t/lib);
 use DBICTest;
 
-my $schema = DBICTest::init_schema();
+my $schema = DBICTest->init_schema();
 
 plan tests => 39;
 
@@ -25,7 +25,7 @@ my $code = sub {
   eval {
     (ref $schema)->txn_do(sub{});
   };
-  like($@, qr/class method/, '$self parameter check ok');
+  like($@, qr/storage/, "can't call txn_do without storage");
   eval {
     $schema->txn_do('');
   };
@@ -117,7 +117,8 @@ my $fail_code = sub {
 
   # Force txn_rollback() to throw an exception
   no warnings 'redefine';
-  local *{"DBIx::Class::Schema::txn_rollback"} = sub{die 'FAILED'};
+  no strict 'refs';
+  local *{"DBIx::Class::Storage::DBI::SQLite::txn_rollback"} = sub{die 'FAILED'};
 
   eval {
     $schema->txn_do($fail_code, $artist);