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