X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F81transactions.t;h=e16ff2bc942df27ed195c01de3c7d41366b39ff1;hb=291bf95f152ff0e9008d67f9d80310b2c6111fdd;hp=5434387e84df115912d32c281159ccaaf1461514;hpb=f32eb113ef8eeecae466e2e950382bc4f7c5469d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/81transactions.t b/t/81transactions.t index 5434387..e16ff2b 100644 --- a/t/81transactions.t +++ b/t/81transactions.t @@ -7,7 +7,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 39; +plan tests => 40; my $code = sub { my ($artist, @cd_titles) = @_; @@ -118,7 +118,7 @@ my $fail_code = sub { # Force txn_rollback() to throw an exception no warnings 'redefine'; no strict 'refs'; - local *{"DBIx::Class::Schema::txn_rollback"} = sub{die 'FAILED'}; + local *{"DBIx::Class::Storage::DBI::SQLite::txn_rollback"} = sub{die 'FAILED'}; eval { $schema->txn_do($fail_code, $artist); @@ -178,3 +178,13 @@ my $fail_code = sub { ok(!defined($cd), q{failed txn_do didn't add failed txn's cd}); } +# Grab a new schema to test txn before connect +{ + my $schema2 = DBICTest->init_schema(no_deploy => 1); + eval { + $schema2->txn_begin(); + $schema2->txn_begin(); + }; + my $err = $@; + ok(($err eq ''), 'Pre-connection nested transactions.'); +}