From: Tomas Doran Date: Mon, 22 Jun 2009 16:31:09 +0000 (+0000) Subject: Test closures in config in the testapp. Makes everything go bang. X-Git-Tag: 5.80014_02~140 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b99e1171ce8ffcafbb958a2065b226f6164622ea Test closures in config in the testapp. Makes everything go bang. --- diff --git a/t/lib/TestApp/Model.pm b/t/lib/TestApp/Model.pm new file mode 100644 index 0000000..418a48b --- /dev/null +++ b/t/lib/TestApp/Model.pm @@ -0,0 +1,16 @@ +package TestApp::Model; +use Moose; +use namespace::clean -except => 'meta'; + +extends 'Catalyst::Model'; + +# Test a closure here, r10394 made this blow up when we clone the config down +# onto the subclass.. +__PACKAGE__->config( + escape_flags => { + 'js' => sub { ${ $_[0] } =~ s/\'/\\\'/g; }, + } +); + +__PACKAGE__->meta->make_immutable; + diff --git a/t/lib/TestApp/Model/ClosuresInConfig.pm b/t/lib/TestApp/Model/ClosuresInConfig.pm new file mode 100644 index 0000000..8f005b4 --- /dev/null +++ b/t/lib/TestApp/Model/ClosuresInConfig.pm @@ -0,0 +1,12 @@ +package TestApp::Model::ClosuresInConfig; +use Moose; +use namespace::clean -except => 'meta'; + +extends 'TestApp::Model'; + +# Note - don't call ->config in here until the constructor calls it to +# retrieve config, so that we get the 'copy from parent' path, +# and ergo break due to the closure if dclone is used there.. + +__PACKAGE__->meta->make_immutable; +