From: Rafael Kitover Date: Wed, 30 Sep 2009 06:53:42 +0000 (+0000) Subject: added test for populate being atomic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbd6f348d0a347da33be7bd6ce50136ff3141e29;p=dbsrgits%2FDBIx-Class-Historic.git added test for populate being atomic --- diff --git a/t/100populate.t b/t/100populate.t index abd70c8..aa3880e 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -6,8 +6,6 @@ use Test::Exception; use lib qw(t/lib); use DBICTest; -plan tests => 24; - my $schema = DBICTest->init_schema(); # The map below generates stuff like: @@ -132,3 +130,26 @@ is((grep { $_->rank == 500 && $_->charfield eq 'mtfnpy' } $rs->all), 5, 'populate with all literal SQL'); + +$rs->delete; + +throws_ok { + $rs->populate([ + { + artistid => 1, + name => 'foo1', + }, + { + artistid => 'foo', # this dies + name => 'foo2', + }, + { + artistid => 3, + name => 'foo3', + }, + ]); +} qr/slice/, 'bad slice'; + +is($rs->count, 0, 'populate is atomic'); + +done_testing;