first cut at :ChildOf
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / ChildOf.pm
diff --git a/t/lib/TestApp/Controller/Action/ChildOf.pm b/t/lib/TestApp/Controller/Action/ChildOf.pm
new file mode 100644 (file)
index 0000000..2bb2818
--- /dev/null
@@ -0,0 +1,25 @@
+package TestApp::Controller::Action::ChildOf;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+sub begin :Private { }
+
+sub foo :PathPart('childof/foo') :Captures(1) :ChildOf('/') { }
+
+sub bar :PathPart('childof/bar') :ChildOf('/') { }
+
+sub endpoint :PathPart('end') :ChildOf('/action/childof/foo') :Args(1) { }
+
+sub finale :ChildOf('bar') :Args { }
+
+sub end :Private {
+  my ($self, $c) = @_;
+  my $out = join('; ', map { join(', ', @$_) }
+                         ($c->req->captures, $c->req->args));
+  $c->res->body($out);
+}
+
+1;