[Bast-commits] r4215 - DBIx-Class/0.08/trunk/t
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Wed Mar 19 22:31:32 GMT 2008
Author: ash
Date: 2008-03-19 22:31:31 +0000 (Wed, 19 Mar 2008)
New Revision: 4215
Modified:
DBIx-Class/0.08/trunk/t/96multi_create.t
Log:
Tests for error propogation of multi create errors
Modified: DBIx-Class/0.08/trunk/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create.t 2008-03-17 21:56:47 UTC (rev 4214)
+++ DBIx-Class/0.08/trunk/t/96multi_create.t 2008-03-19 22:31:31 UTC (rev 4215)
@@ -194,3 +194,13 @@
my $new_cd = $schema->resultset("CD")->create($new_cd_hashref);
is($new_cd->artist->id, 17, 'new id retained okay');
+
+
+# Make sure exceptions from errors in created rels propogate
+eval {
+ my $t = $schema->resultset("Track")->new({});
+ $t->cd($t->new_related('cd', { artist => undef } ) );
+ $t->{_rel_in_storage} = 0;
+ $t->insert;
+};
+like($@, qr/cd.artist may not be NULL/, "Exception propogated properly");
More information about the Bast-commits
mailing list