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