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