Fix test suite to work again with DBICTEST_SQLITE_USE_FILE
[dbsrgits/DBIx-Class.git] / t / cdbi / sweet / 08pager.t
index 2f037cc..7f94e51 100644 (file)
@@ -1,3 +1,5 @@
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
 use strict;
 use warnings;
 
@@ -6,15 +8,6 @@ use Test::More;
 use lib 't/lib';
 use DBICTest;
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;";
-  if ($@) {
-    plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
-    next;
-  }
-  plan tests => 9;
-}
-
 DBICTest::Schema::CD->load_components(qw/CDBICompat CDBICompat::Pager/);
 
 my $schema = DBICTest->init_schema(compose_connection => 1);
@@ -70,13 +63,4 @@ is( $it->next, undef, "disable_sql_paging next past end of page ok" );
 );
 is( $it->count, 1, "complex abstract count ok" );
 
-# cleanup globals so we do not trigger the leaktest
-for ( map { DBICTest->schema->class($_) } DBICTest->schema->sources ) {
-  $_->class_resolver(undef);
-  $_->resultset_instance(undef);
-  $_->result_source_instance(undef);
-}
-{
-  no warnings qw/redefine once/;
-  *DBICTest::schema = sub {};
-}
+done_testing;