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