6 # Remove all relevant env variables to avoid accidental fail
7 foreach my $name ( grep { m{^(CATALYST|MOCKAPPENV)} } keys %ENV ) {
11 $ENV{ CATALYST_HOME } = cwd . '/t/lib/MockAppConfigLoader';
12 $ENV{ MOCKAPPENV_CONFIG } = $ENV{ CATALYST_HOME } . '/mockapp.pl';
16 __PACKAGE__->config->{substitutions} = {
17 foo => sub { shift; join( '-', @_ ); }
22 ok( my $conf = __PACKAGE__->config, 'config loads' );
23 is( $conf->{ 'Controller::Foo' }->{ foo }, 'bar' );
24 is( $conf->{ 'Controller::Foo' }->{ new }, 'key' );
25 is( $conf->{ 'Model::Baz' }->{ qux }, 'xyzzy' );
26 is( $conf->{ 'Model::Baz' }->{ another }, 'new key' );
27 is( $conf->{ 'view' }, 'View::TT::New' );
28 is( $conf->{ 'foo_sub' }, 'x-y' );
29 is( $conf->{ 'literal_macro' }, '__DATA__', 'literal macro' );
30 is( $conf->{ 'environment_macro' }, $ENV{ CATALYST_HOME }.'/mockapp.pl', 'environment macro' );