Test closures in config in the testapp. Makes everything go bang.
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Model.pm
diff --git a/t/lib/TestApp/Model.pm b/t/lib/TestApp/Model.pm
new file mode 100644 (file)
index 0000000..418a48b
--- /dev/null
@@ -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;
+