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