[Bast-commits] r8300 - DBIx-Class/0.08/branches/prefetch/t/prefetch
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed Jan 13 21:32:48 GMT 2010
Author: ribasushi
Date: 2010-01-13 21:32:47 +0000 (Wed, 13 Jan 2010)
New Revision: 8300
Modified:
DBIx-Class/0.08/branches/prefetch/t/prefetch/multiple_hasmany_torture.t
Log:
Reorg test a little
Modified: DBIx-Class/0.08/branches/prefetch/t/prefetch/multiple_hasmany_torture.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/prefetch/multiple_hasmany_torture.t 2010-01-13 21:18:07 UTC (rev 8299)
+++ DBIx-Class/0.08/branches/prefetch/t/prefetch/multiple_hasmany_torture.t 2010-01-13 21:32:47 UTC (rev 8300)
@@ -5,23 +5,28 @@
use Test::Exception;
use lib qw(t/lib);
use DBICTest;
-use IO::File;
my $schema = DBICTest->init_schema();
-# $artist_rs->search(
-# {},
-# {
-# prefetch => [
-# {
-# cds => [
-# { tracks => { cd_single => 'tracks } },
-# { producer_to_cd => 'producer' }
-# ]
-# },
-# { artwork_to_artist => 'artwork' } ] );
+my $mo_rs = $schema->resultset('Artist')->search(
+ { 'me.artistid' => 4 },
+ {
+ prefetch => [
+ {
+ cds => [
+ { tracks => { cd_single => 'tracks' } },
+ { cd_to_producer => 'producer' }
+ ]
+ },
+ { artwork_to_artist => 'artwork' }
+ ],
-my $cd = $schema->resultset('Artist')->create(
+ result_class => 'DBIx::Class::ResultClass::HashRefInflator',
+ }
+);
+
+
+$schema->resultset('Artist')->create(
{
name => 'mo',
rank => '1337',
@@ -81,22 +86,6 @@
}
);
-my $mo_rs = $schema->resultset('Artist')->search(
- { 'me.artistid' => 4 },
- {
- result_class => 'DBIx::Class::ResultClass::HashRefInflator',
- prefetch => [
- {
- cds => [
- { tracks => { cd_single => 'tracks' } },
- { cd_to_producer => 'producer' }
- ]
- },
- { artwork_to_artist => 'artwork' }
- ],
- }
-);
-
my $mo = $mo_rs->next;
is( @{$mo->{cds}}, 2, 'two CDs' );
More information about the Bast-commits
mailing list