Commit | Line | Data |
a7afecf7 |
1 | package MockApp; |
2 | |
25cd1420 |
3 | use Test::More tests => 10; |
a7afecf7 |
4 | |
5 | use Cwd; |
fd72f4e8 |
6 | local %ENV; |
a7afecf7 |
7 | $ENV{ CATALYST_HOME } = cwd . '/t/mockapp'; |
8 | |
9 | use_ok( 'Catalyst', qw( ConfigLoader ) ); |
10 | |
af391898 |
11 | __PACKAGE__->config->{ 'Plugin::ConfigLoader' }->{ substitutions } = { |
587d381b |
12 | foo => sub { shift; join( '-', @_ ); } |
d392c48d |
13 | }; |
14 | |
a7afecf7 |
15 | __PACKAGE__->setup; |
16 | |
a7afecf7 |
17 | ok( __PACKAGE__->config ); |
18 | is( __PACKAGE__->config->{ 'Controller::Foo' }->{ foo }, 'bar' ); |
19 | is( __PACKAGE__->config->{ 'Controller::Foo' }->{ new }, 'key' ); |
587d381b |
20 | is( __PACKAGE__->config->{ 'Model::Baz' }->{ qux }, 'xyzzy' ); |
21 | is( __PACKAGE__->config->{ 'Model::Baz' }->{ another }, 'new key' ); |
22 | is( __PACKAGE__->config->{ 'view' }, 'View::TT::New' ); |
23 | is( __PACKAGE__->config->{ 'foo_sub' }, 'x-y' ); |
24 | is( __PACKAGE__->config->{ 'literal_macro' }, '__DATA__' ); |
25cd1420 |
25 | is( __PACKAGE__->config->{ 'Plugin::Zot' }->{ zoot }, 'zooot'); |