renamed MockApp so that it doesn't fail when run aggregate tests
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_container_mock_load_env.t
1 package MockAppEnv;
2
3 use Test::More tests => 10;
4 use Cwd;
5
6 {
7 # Remove all relevant env variables to avoid accidental fail
8     foreach my $name ( grep { m{^(CATALYST|MOCKAPPENV)} } keys %ENV ) {
9         delete $ENV{ $name };
10     }
11
12     $ENV{ CATALYST_HOME }  = cwd . '/t/mockapp';
13     $ENV{ MOCKAPPENV_CONFIG } = $ENV{ CATALYST_HOME } . '/mockapp.pl';
14
15     use_ok( 'Catalyst' );
16
17     __PACKAGE__->config->{substitutions} = {
18         foo => sub { shift; join( '-', @_ ); }
19     };
20
21     __PACKAGE__->setup;
22 }
23
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' );