X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F66relationship.t;h=73925d4ef6ec341219b2d52aaf851d076962e62b;hb=672c8df5fcf20b4c0894ccd3763702522a9f829d;hp=406e289298fdc14a9d6f81d14d2ef66317204f0d;hpb=365d06b716eb2b3894d83291c612b116ade1e9d7;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/66relationship.t b/t/66relationship.t index 406e289..73925d4 100644 --- a/t/66relationship.t +++ b/t/66relationship.t @@ -7,7 +7,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 54; +plan tests => 56; # has_a test my $cd = $schema->resultset("CD")->find(4); @@ -162,6 +162,11 @@ is( $cd->producers->count(), $prod_before_count+2, 'many_to_many set_$rel(@objs) count ok' ); $cd->set_producers($schema->resultset('Producer')->find(1)); is( $cd->producers->count(), 1, 'many_to_many set_$rel($obj) count ok' ); +$cd->set_producers([$schema->resultset('Producer')->all]); +is( $cd->producers->count(), $prod_before_count+2, + 'many_to_many set_$rel(\@objs) count ok' ); +$cd->set_producers([$schema->resultset('Producer')->find(1)]); +is( $cd->producers->count(), 1, 'many_to_many set_$rel([$obj]) count ok' ); eval { $cd->remove_from_producers({ fake => 'hash' }); }; like( $@, qr/needs an object/, 'remove_from_$rel($hash) dies correctly' );