perltidy
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / 21-mock_load_env.t
CommitLineData
4f63af80 1package MockApp;
2
3use Test::More tests => 9;
4
5use Cwd;
587d381b 6$ENV{ CATALYST_HOME } = cwd . '/t/mockapp';
4f63af80 7$ENV{ MOCKAPP_CONFIG } = $ENV{ CATALYST_HOME } . '/mockapp.pl';
8
9use_ok( 'Catalyst', qw( ConfigLoader ) );
10
11__PACKAGE__->config->{ 'Plugin::ConfigLoader' }->{ substitutions } = {
587d381b 12 foo => sub { shift; join( '-', @_ ); }
4f63af80 13};
14
15__PACKAGE__->setup;
16
17ok( __PACKAGE__->config );
18is( __PACKAGE__->config->{ 'Controller::Foo' }->{ foo }, 'bar' );
19is( __PACKAGE__->config->{ 'Controller::Foo' }->{ new }, 'key' );
587d381b 20is( __PACKAGE__->config->{ 'Model::Baz' }->{ qux }, 'xyzzy' );
21is( __PACKAGE__->config->{ 'Model::Baz' }->{ another }, 'new key' );
22is( __PACKAGE__->config->{ 'view' }, 'View::TT::New' );
23is( __PACKAGE__->config->{ 'foo_sub' }, 'x-y' );
24is( __PACKAGE__->config->{ 'literal_macro' }, '__DATA__' );