Allow models and components to specify the names of any components they generate
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Model / Generating.pm
diff --git a/t/lib/TestApp/Model/Generating.pm b/t/lib/TestApp/Model/Generating.pm
new file mode 100644 (file)
index 0000000..24981e0
--- /dev/null
@@ -0,0 +1,22 @@
+package TestApp::Model::Generating;
+use Moose;
+extends 'Catalyst::Model';
+
+sub BUILD {
+    Class::MOP::Class->create(
+        'TestApp::Model::Generated' => (
+            methods => {
+                foo => sub { 'foo' }
+            }
+        )
+    );
+}
+
+sub expand_modules {
+    return ('TestApp::Model::Generated');
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;