X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F76joins.t;h=b0d92f8a2757ebdbc65f292a48f5119183e401c1;hb=9345b14c6c86aa8888bf5d47a569ee9bbde24f47;hp=ba87a0a04ea1b7251ecb9e93a497ce006dd5443f;hpb=bfa46eb523fff8ece9b37a48d17b90510f1c8c52;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/76joins.t b/t/76joins.t index ba87a0a..b0d92f8 100644 --- a/t/76joins.t +++ b/t/76joins.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); @@ -10,17 +10,8 @@ my $schema = DBICTest->init_schema(); my $orig_debug = $schema->storage->debug; -use IO::File; - -BEGIN { - eval "use DBD::SQLite"; - plan $@ - ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 33 ); -} - # test the abstract join => SQL generator -my $sa = new DBIx::Class::SQLAHacks; +my $sa = new DBIx::Class::SQLMaker; my @j = ( { child => 'person' }, @@ -109,15 +100,6 @@ is_same_sql( 'join 5 (SCALAR reference for ON statement) ok' ); -my @j6 = ( - { child => 'person' }, - [ { father => 'person' }, { 'father.person_id' => { '!=', '42' } }, ], - [ { mother => 'person' }, { 'mother.person_id' => 'child.mother_id' } ], -); -$match = qr/HASH reference arguments are not supported in JOINS/; -eval { $sa->_recurse_from(@j6) }; -like( $@, $match, 'join 6 (HASH reference for ON statement dies) ok' ); - my $rs = $schema->resultset("CD")->search( { 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' }, { from => [ { 'me' => 'cd' }, @@ -185,7 +167,7 @@ is($rs->first->name, 'We Are Goth', 'Correct record returned'); [ 4, 7 ], [ 4, 8 ], ]); - + sub cd_count { return $schema->resultset("CD")->count; } @@ -195,7 +177,7 @@ is($rs->first->name, 'We Are Goth', 'Correct record returned'); is(cd_count(), 8, '8 rows in table cd'); is(tk_count(), 7, '7 rows in table twokeys'); - + sub artist1 { return $schema->resultset("CD")->search( { 'artist.name' => 'Caterwauler McCrae' }, @@ -242,3 +224,5 @@ is($rs->first->name, 'We Are Goth', 'Correct record returned'); is(cd_count(), 5, '5 rows in table cd'); is(tk_count(), 3, '3 rows in table twokeys'); } + +done_testing;