force CDBICompat deps for developers, fix tests to work with latest Class::Trigger
Matt S Trout [Tue, 21 Aug 2007 19:52:09 +0000 (19:52 +0000)]
Makefile.PL
t/cdbi-t/11-triggers.t

index 1e84a29..67326b5 100644 (file)
@@ -29,9 +29,11 @@ install_script 'script/dbicadmin';
 
 tests "t/*.t t/*/*.t";
 
-# re-build README if we're in an svk checkout
-if( -e 'MANIFEST.SKIP' ) {
-    system('pod2text lib/DBIx/Class.pm > README');
+# re-build README and require CDBI modules for testing if we're in a checkout
+if( -e 'inc/.author' ) {
+  build_requires 'DBIx::ContextualFetch';
+  build_requires 'Class::Trigger';
+  system('pod2text lib/DBIx/Class.pm > README');
 }
 
 auto_provides;
index 5626763..f25957c 100644 (file)
@@ -25,13 +25,11 @@ sub pst_up_trigger { ::ok(1, "Running post-update trigger"); }
 
 sub default_rating { $_[0]->Rating(15); }
 
-Film->add_trigger(
-       before_create => \&default_rating,
-       after_create  => \&create_trigger2,
-       after_delete  => \&delete_trigger,
-       before_update => \&pre_up_trigger,
-       after_update  => \&pst_up_trigger,
-);
+Film->add_trigger(before_create => \&default_rating);
+Film->add_trigger(after_create  => \&create_trigger2);
+Film->add_trigger(after_delete  => \&delete_trigger);
+Film->add_trigger(before_update => \&pre_up_trigger);
+Film->add_trigger(after_update  => \&pst_up_trigger);
 
 ok(
        my $ver = Film->create({