do not localize %ENV, rather, remove potentially conflicting k-v pairs (RT #48557)
Brian Cassidy [Mon, 10 Aug 2009 11:32:56 +0000 (11:32 +0000)]
Changes
t/20-mock_load.t
t/21-mock_load_env.t

diff --git a/Changes b/Changes
index 4941418..ca20a45 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,6 +2,8 @@ Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
 
 0.26  XXX
     - Fix test to not need "parent" (RT #48547)
+    - Do not localize %ENV, rather, remove potentially conflicting
+      k-v pairs (RT #48557)
 
 0.25  Fri Aug 07 2009
     - Fix get_config_local_suffix and get_config_path when finding values 
index 0190b80..987dd23 100644 (file)
@@ -1,9 +1,13 @@
 package MockApp;
 
 use Test::More tests => 10;
-
 use Cwd;
-local %ENV;
+
+# Remove all relevant env variables to avoid accidental fail
+foreach my $name ( grep { m{^(CATALYST)} } keys %ENV ) {
+    delete $ENV{ $name };
+}
+
 $ENV{ CATALYST_HOME } = cwd . '/t/mockapp';
 
 use_ok( 'Catalyst', qw( ConfigLoader ) );
index 151ec12..5cc3ff5 100644 (file)
@@ -1,9 +1,13 @@
 package MockApp;
 
 use Test::More tests => 10;
-
 use Cwd;
-local %ENV;
+
+# Remove all relevant env variables to avoid accidental fail
+foreach my $name ( grep { m{^(CATALYST|MOCKAPP)} } keys %ENV ) {
+    delete $ENV{ $name };
+} 
+
 $ENV{ CATALYST_HOME }  = cwd . '/t/mockapp';
 $ENV{ MOCKAPP_CONFIG } = $ENV{ CATALYST_HOME } . '/mockapp.pl';