[Jifty-commit] r1183 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 7 13:47:10 EDT 2006


Author: clkao
Date: Wed Jun  7 13:47:08 2006
New Revision: 1183

Modified:
   jifty/trunk/lib/Jifty/Test.pm

Log:
Use a temp file to store test-only config so we can reuse in spawned
processes.


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Wed Jun  7 13:47:08 2006
@@ -34,10 +34,10 @@
 sub setup {
     my $class = shift;
 
-    $Jifty::Config::postload = sub {
-        my $self = shift;
-        $self->stash(Hash::Merge::merge($self->stash, $class->test_config($self)));
-    };
+    my $test_config = File::Temp->new;
+    Jifty::YAML::DumpFile($test_config, $class->test_config(Jifty::Config->new));
+    # Invoking bin/jifty and friends will now have the test config ready.
+    $ENV{'JIFTY_SITE_CONFIG'} ||= $test_config;
     {
         # Cache::Memcached stores things. And doesn't let them
         # expire from the cache easily. This is fine in production,


More information about the Jifty-commit mailing list