X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20-mock_load.t;h=78fa1468aa0bd347b3e6271190fc4a91d9a91103;hb=25cd1420f9c25186c80c8c23ee8dc2b8d54aa793;hp=f20183f53cb5a0ec56d4f2bfe2c3ae057c2b54b7;hpb=a7afecf726304cbb5556cd5d93ad823e0ac4945f;p=catagits%2FCatalyst-Plugin-ConfigLoader.git diff --git a/t/20-mock_load.t b/t/20-mock_load.t index f20183f..78fa146 100644 --- a/t/20-mock_load.t +++ b/t/20-mock_load.t @@ -1,19 +1,24 @@ package MockApp; -use Test::More tests => 7; +use Test::More tests => 10; use Cwd; $ENV{ CATALYST_HOME } = cwd . '/t/mockapp'; use_ok( 'Catalyst', qw( ConfigLoader ) ); -__PACKAGE__->setup; +__PACKAGE__->config->{ 'Plugin::ConfigLoader' }->{ substitutions } = { + foo => sub { shift; join( '-', @_ ); } +}; -use Data::Dumper; print Dumper __PACKAGE__->config; +__PACKAGE__->setup; ok( __PACKAGE__->config ); is( __PACKAGE__->config->{ 'Controller::Foo' }->{ foo }, 'bar' ); is( __PACKAGE__->config->{ 'Controller::Foo' }->{ new }, 'key' ); -is( __PACKAGE__->config->{ 'Model::Baz' }->{ qux }, 'xyzzy' ); -is( __PACKAGE__->config->{ 'Model::Baz' }->{ another }, 'new key' ); -is( __PACKAGE__->config->{ 'view' }, 'View::TT::New' ); +is( __PACKAGE__->config->{ 'Model::Baz' }->{ qux }, 'xyzzy' ); +is( __PACKAGE__->config->{ 'Model::Baz' }->{ another }, 'new key' ); +is( __PACKAGE__->config->{ 'view' }, 'View::TT::New' ); +is( __PACKAGE__->config->{ 'foo_sub' }, 'x-y' ); +is( __PACKAGE__->config->{ 'literal_macro' }, '__DATA__' ); +is( __PACKAGE__->config->{ 'Plugin::Zot' }->{ zoot }, 'zooot');