Merge branch 'master' into gsoc_breadboard
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_container_mock_load.t
1 package MockApp;
2
3 use Test::More;
4 use Cwd;
5
6 # Remove all relevant env variables to avoid accidental fail
7 foreach my $name ( grep { m{^(CATALYST)} } keys %ENV ) {
8     delete $ENV{ $name };
9 }
10
11 $ENV{ CATALYST_HOME } = cwd . '/t/lib/MockAppConfigLoader';
12
13 use_ok( 'Catalyst' );
14
15 __PACKAGE__->config->{ substitutions } = {
16     foo => sub { shift; join( '-', @_ ); }
17 };
18
19 __PACKAGE__->setup;
20
21 ok( my $conf = __PACKAGE__->config, 'config loads' );
22 is( $conf->{ 'Controller::Foo' }->{ foo }, 'bar' );
23 is( $conf->{ 'Controller::Foo' }->{ new }, 'key' );
24 is( $conf->{ 'Model::Baz' }->{ qux },      'xyzzy' );
25 is( $conf->{ 'Model::Baz' }->{ another },  'new key' );
26 is( $conf->{ 'view' },                     'View::TT::New' );
27 is( $conf->{ 'foo_sub' },                  'x-y' );
28 is( $conf->{ 'literal_macro' },            '__DATA__', 'literal macro' );
29 is( $conf->{ 'Plugin::Zot' }->{ zoot },    'zooot');
30
31 done_testing;