X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=t%2F93single_accessor_object.t;h=e250183ad3576984a169e67255b5c008c2e884da;hp=41ac5da92f0b11eba1dca0b9d803929a71a10325;hb=d9c17594ab3be0b866c555750cdbd1ad6a1b34e6;hpb=574d9b690cd9687feed73e81adf35ed589f0d7eb diff --git a/t/93single_accessor_object.t b/t/93single_accessor_object.t index 41ac5da..e250183 100644 --- a/t/93single_accessor_object.t +++ b/t/93single_accessor_object.t @@ -6,13 +6,10 @@ use Test::Exception; use lib qw(t/lib); use DBICTest; -my $schema = DBICTest->init_schema(); - -plan tests => 10; - # Test various uses of passing an object to find, create, and update on a single # rel accessor { + my $schema = DBICTest->init_schema(); my $artist = $schema->resultset("Artist")->find(1); my $cd = $schema->resultset("CD")->find_or_create({ @@ -42,9 +39,9 @@ plan tests => 10; is($track->get_column('cd'), $another_cd->cdid, 'track matches another CD after update'); } -$schema = DBICTest->init_schema(); { + my $schema = DBICTest->init_schema(); my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' }); my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982, genreid => undef }); @@ -52,9 +49,8 @@ $schema = DBICTest->init_schema(); ok(!defined($cd->genre), 'genre accessor returns undef'); } -$schema = DBICTest->init_schema(); - { + my $schema = DBICTest->init_schema(); my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' }); my $genre = $schema->resultset('Genre')->create({ genreid => 88, name => 'disco' }); my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982 }); @@ -62,3 +58,4 @@ $schema = DBICTest->init_schema(); dies_ok { $cd->genre } 'genre accessor throws without column'; } +done_testing;