Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class-Historic.git] / t / cdbi / abstract / search_where.t
index 2fb28ff..28e5b04 100644 (file)
@@ -1,21 +1,13 @@
-use Test::More;
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
 
 use strict;
 use warnings;
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;";
-  if ($@) {
-    plan (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@");
-  }
-  plan tests => 10;
-}
-
-INIT {
-  use lib 't/cdbi/testlib';
-  use Film;
-}
+use Test::More;
 
+use lib 't/cdbi/testlib';
+use Film;
 
 Film->create({ Title => $_, Rating => "PG" }) for ("Superman", "Super Fuzz");
 Film->create({ Title => "Batman", Rating => "PG13" });
@@ -29,7 +21,7 @@ is $superman->next, undef;
     is_deeply [sort map $_->Title, @supers],
               [sort ("Super Fuzz", "Superman")], 'like';
 }
-    
+
 
 my @all = Film->search_where({}, { order_by => "Title ASC" });
 is_deeply ["Batman", "Super Fuzz", "Superman"],
@@ -68,3 +60,4 @@ is_deeply ["Super Fuzz", "Superman"],
           [map $_->Title, @all],
           "limit_dialect ignored";
 
+done_testing;