X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Ftxn.t;fp=t%2F81transactions.t;h=4fe7772deb17f5dfc94c76666cea4b924f5125b2;hb=38ed54cd3980bd344e13fad27ed11b935ae932aa;hp=a13c651f383a2cae282af9b01fb8036cacee237c;hpb=9e34d55419481925691c7177d43ba48ec02b02eb;p=dbsrgits%2FDBIx-Class.git diff --git a/t/81transactions.t b/t/storage/txn.t similarity index 97% rename from t/81transactions.t rename to t/storage/txn.t index a13c651..4fe7772 100644 --- a/t/81transactions.t +++ b/t/storage/txn.t @@ -63,6 +63,13 @@ my $code = sub { is( $schema->storage->{transaction_depth}, 0, 'txn depth has been reset'); } +# Test txn_do() @_ aliasing support +{ + my $res = 'original'; + $schema->storage->txn_do (sub { $_[0] = 'changed' }, $res); + is ($res, 'changed', "Arguments properly aliased for txn_do"); +} + # Test nested successful txn_do() { is( $schema->storage->{transaction_depth}, 0, 'txn depth starts at 0'); @@ -233,6 +240,7 @@ $schema->storage->disconnect; is($schema->storage->transaction_depth, 0, "Correct transaction depth"); my $artist_rs = $schema->resultset('Artist'); + my $fn = __FILE__; throws_ok { my $guard = $schema->txn_scope_guard; @@ -243,7 +251,7 @@ $schema->storage->disconnect; }); $guard->commit; - } qr/No such column made_up_column .*? at .*?81transactions.t line \d+/s, "Error propogated okay"; + } qr/No such column made_up_column .*? at .*?$fn line \d+/s, "Error propogated okay"; ok(!$artist_rs->find({name => 'Death Cab for Cutie'}), "Artist not created");