[Jifty-commit] r4812 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jan 10 16:48:25 EST 2008


Author: alexmv
Date: Thu Jan 10 16:48:25 2008
New Revision: 4812

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r26575 at zoq-fot-pik:  chmrr | 2008-01-10 16:47:54 -0500
  * Output a plan before loading modules


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Thu Jan 10 16:48:25 2008
@@ -4,9 +4,6 @@
 package Jifty::Test;
 use base qw/Test::More/;
 
-use Jifty::YAML;
-use Jifty::Server;
-use Jifty::Script::Schema;
 use Email::LocalDelivery;
 use Email::Folder;
 use File::Path;
@@ -119,8 +116,23 @@
 sub import_extra {
     my $class = shift;
     my $args  = shift;
+    # Spit out a plan *before* we load modules, in case of compilation
+    # errors
+    $class->builder->plan(@{$args});
+
+    # Require the things we need
+    require Jifty::YAML;
+    require Jifty::Server;
+    require Jifty::Script::Schema;
     $class->setup($args);
     Test::More->export_to_level(2);
+
+    # Now, clobber Test::Builder::plan so we don't try to spit out the
+    # plan *again* later
+    {
+        no warnings 'redefine';
+        *Test::Builder::plan = sub {};
+    }
 }
 
 =head2 setup ARGS
@@ -180,8 +192,8 @@
           use vars qw/$cache_key_prefix/;
 
           $cache_key_prefix = "jifty-test-" . $$;
-        
-          sub cache_key_prefix {
+          
+          *Jifty::Record::cache_key_prefix = sub {
               $Jifty::Record::cache_key_prefix;
           }
       }


More information about the Jifty-commit mailing list