Skip tests if DateTime is not installed.
[dbsrgits/DBIx-Class.git] / t / cdbi-sweet-t / 08pager.t
index ab5211a..07166e6 100644 (file)
@@ -3,16 +3,25 @@ use warnings;
 
 use Test::More;
 
-eval "use DBD::SQLite";
-plan skip_all => 'needs DBD::SQLite for testing' if $@;
-
-plan tests => 10;
+BEGIN {
+  eval "use DBIx::Class::CDBICompat;";
+  if ($@) {
+    plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
+    next;
+  }
+  eval "use DBD::SQLite";
+  plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 10);
+}
 
 use lib 't/lib';
 
 use_ok('DBICTest');
 
-DBICTest::CD->load_components(qw/CDBICompat::Pager/);
+DBICTest::Schema::CD->load_components(qw/CDBICompat CDBICompat::Pager/);
+
+my $schema = DBICTest->init_schema(compose_connection => 1);
+
+DBICTest::CD->result_source_instance->schema->storage($schema->storage);
 
 my ( $pager, $it ) = DBICTest::CD->page(
     {},