First part of changes for better unexpected NULL reporting
[dbsrgits/DBIx-Class-Historic.git] / t / prefetch / refined_search_on_relation.t
index 8a7035c..e27687c 100644 (file)
@@ -1,8 +1,10 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
-use lib qw(t/lib);
+
 use DBICTest;
 
 my $schema = DBICTest->init_schema();
@@ -25,11 +27,7 @@ is (
 );
 
 # this still should emit no queries:
-{
-  my $queries = 0;
-  my $orig_debug = $schema->storage->debug;
-  $schema->storage->debugcb(sub { $queries++; });
-  $schema->storage->debug(1);
+$schema->is_executed_querycount( sub {
 
   my $cds = $art->cds;
   is (
@@ -47,10 +45,6 @@ is (
     );
   }
 
-  $schema->storage->debug($orig_debug);
-  $schema->storage->debugcb(undef);
-
-  is ($queries, 0, 'No queries on prefetched operations');
-}
+}, 0, 'No queries on prefetched operations');
 
 done_testing;