Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class-Historic.git] / t / prefetch / with_limit.t
index 480dc40..5b1bb83 100644 (file)
@@ -1,3 +1,5 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 # Test to ensure we get a consistent result set wether or not we use the
 # prefetch option in combination rows (LIMIT).
 use strict;
@@ -5,9 +7,8 @@ use warnings;
 
 use Test::More;
 use Test::Exception;
-use lib qw(t/lib);
-use DBICTest;
-use DBIC::SqlMakerTest;
+
+use DBICTest ':DiffSQL';
 use DBIx::Class::SQLMaker::LimitDialects;
 
 my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype;
@@ -152,8 +153,8 @@ throws_ok (
       {'tracks.title' => { '!=' => 'foo' }},
       { order_by => \ 'some oddball literal sql', join => { cds => 'tracks' } }
     )->next
-  }, qr/A required group_by clause could not be constructed automatically/,
-) || exit;
+  }, qr/Unable to programatically derive a required group_by from the supplied order_by criteria/,
+);
 
 my $artist = $use_prefetch->search({'cds.title' => $artist_many_cds->cds->first->title })->next;
 is($artist->cds->count, 1, "count on search limiting prefetched has_many");