Switch CDBICompat and its tests to OptDeps
[dbsrgits/DBIx-Class.git] / t / cdbi / 11-triggers.t
index 918403a..cd322e5 100644 (file)
@@ -1,15 +1,9 @@
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
 use strict;
-use Test::More;
+use warnings;
 
-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 => 13);
-}
+use Test::More;
 
 use lib 't/cdbi/testlib';
 use Film;
@@ -58,9 +52,11 @@ is + (
 ok $ver->delete, "Delete";
 
 {
-  Film->add_trigger(before_create => sub { 
+  Film->add_trigger(before_create => sub {
     my $self = shift;
     ok !$self->_attribute_exists('title'), "PK doesn't auto-vivify";
   });
   Film->create({director => "Me"});
 }
+
+done_testing;