Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
0.25 Fri Aug 07 2009
- - Test case for RT #47937 - MYAPP_CONFIG_LOCAL_SUFFIX ignored w/
- Catalyst::Test (Dan Dascalescu) and patch (prestemon)
+ - Fix get_config_local_suffix and get_config_path when finding values
+ from ENV vars (RT #47937)
0.24 Mon Jun 29 2009
- Add an __ENV(foo)__ macro + tests (Stuart Watt)
my $appname = ref $c || $c;
my $prefix = Catalyst::Utils::appprefix( $appname );
- my $path = Catalyst::Utils::env_value( $c, 'CONFIG' )
+ my $path = Catalyst::Utils::env_value( $appname, 'CONFIG' )
|| $c->config->{ 'Plugin::ConfigLoader' }->{ file }
|| $c->path_to( $prefix );
--- /dev/null
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More tests => 3;
+
+BEGIN {
+ $ENV{ TESTAPP_CONFIG_LOCAL_SUFFIX } = 'test';
+ use_ok 'Catalyst::Test', 'TestApp';
+}
+
+ok my ( $res, $c ) = ctx_request( '/' ), 'context object';
+
+is $c->get_config_local_suffix, 'test', 'suffix is "test"';
--- /dev/null
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More tests => 3;
+
+BEGIN {
+ $ENV{ TESTAPP_CONFIG } = 'test.perl';
+ use_ok 'Catalyst::Test', 'TestApp';
+}
+
+ok my ( $res, $c ) = ctx_request( '/' ), 'context object';
+
+is_deeply [ $c->get_config_path ], [ qw( test.perl perl ) ], 'path is "test.perl"';
+++ /dev/null
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-
-use Test::More tests => 2;
-
-BEGIN {
- $ENV{TESTAPP_CONFIG_LOCAL_SUFFIX} = 'test';
-}
-use Catalyst::Test 'TestApp';
-
-ok my ($res, $c) = ctx_request('/'), 'context object';
-
-is $c->get_config_local_suffix, 'test', 'RT #47937';