X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F98savepoints.t;h=a195b8580ce7a0aa1d0e47d29c60dbefd4b152b8;hb=66a65d81075460c8508f300b26209bc77cbed6d6;hp=03365ec150f82d5272e7299cfc2c17614b122432;hpb=ae1d3ea19c3cb0c012ff099f8c10ff4127c5c57e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/98savepoints.t b/t/98savepoints.t index 03365ec..a195b85 100644 --- a/t/98savepoints.t +++ b/t/98savepoints.t @@ -96,7 +96,7 @@ for my $prefix (keys %$env2optdep) { SKIP: { cmp_ok($arty->name, 'eq', 'gphat', 'name changed'); # Active: 0 1 2 # Rollback doesn't DESTROY the savepoint, it just rolls back to the value - # at it's conception + # at its conception $schema->svp_rollback('testing2'); $arty->discard_changes; cmp_ok($arty->name, 'eq', 'yourmom', 'testing2 reverted'); @@ -129,17 +129,19 @@ for my $prefix (keys %$env2optdep) { SKIP: { # And now to see if txn_do will behave correctly $schema->txn_do (sub { + my $artycp = $arty; + $schema->txn_do (sub { - $arty->name ('Muff'); - $arty->update; + $artycp->name ('Muff'); + $artycp->update; }); eval { $schema->txn_do (sub { - $arty->name ('Moff'); - $arty->update; - $arty->discard_changes; - is($arty->name,'Moff','Value updated in nested transaction'); + $artycp->name ('Moff'); + $artycp->update; + $artycp->discard_changes; + is($artycp->name,'Moff','Value updated in nested transaction'); $schema->storage->dbh->do ("GUARANTEED TO PHAIL"); }); }; @@ -170,5 +172,7 @@ for my $prefix (keys %$env2optdep) { SKIP: { done_testing; -END { eval { $schema->storage->dbh->do ("DROP TABLE artist") } if defined $schema } - +END { + eval { $schema->storage->dbh->do ("DROP TABLE artist") } if defined $schema; + undef $schema; +}