Fix test to not need "parent" (RT #48547)
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / 20-mock_load.t
CommitLineData
a7afecf7 1package MockApp;
2
25cd1420 3use Test::More tests => 10;
a7afecf7 4
5use Cwd;
fd72f4e8 6local %ENV;
a7afecf7 7$ENV{ CATALYST_HOME } = cwd . '/t/mockapp';
8
9use_ok( 'Catalyst', qw( ConfigLoader ) );
10
af391898 11__PACKAGE__->config->{ 'Plugin::ConfigLoader' }->{ substitutions } = {
587d381b 12 foo => sub { shift; join( '-', @_ ); }
d392c48d 13};
14
a7afecf7 15__PACKAGE__->setup;
16
a7afecf7 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__' );
25cd1420 25is( __PACKAGE__->config->{ 'Plugin::Zot' }->{ zoot }, 'zooot');