Release commit for 0.35
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / 21-mock_load_env.t
index 7bdacf6..ad0dd2a 100644 (file)
@@ -1,8 +1,13 @@
 package MockApp;
 
-use Test::More tests => 9;
-
+use Test::More tests => 10;
 use Cwd;
+
+# 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';
 
@@ -22,3 +27,4 @@ is( __PACKAGE__->config->{ 'Model::Baz' }->{ another },  'new key' );
 is( __PACKAGE__->config->{ 'view' },                     'View::TT::New' );
 is( __PACKAGE__->config->{ 'foo_sub' },                  'x-y' );
 is( __PACKAGE__->config->{ 'literal_macro' },            '__DATA__' );
+is( __PACKAGE__->config->{ 'environment_macro' },        $ENV{ CATALYST_HOME }.'/mockapp.pl' );