summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--t/05_graph.t18
-rw-r--r--t/lib/TestApp.pm8
-rw-r--r--t/lib/TestApp/Controller/Root.pm16
3 files changed, 42 insertions, 0 deletions
diff --git a/t/05_graph.t b/t/05_graph.t
new file mode 100644
index 0000000..e995e75
--- /dev/null
+++ b/t/05_graph.t
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More tests => 1;
+use lib ('t/lib');
+use CatalystX::Dispatcher::AsGraph;
+
+my $graph = CatalystX::Dispatcher::AsGraph->new(
+ appname => 'TestApp',
+ output => 'test'
+);
+$graph->run;
+is $graph->graph->as_txt, <<'...';
+[ / ] --> [ \[action\] edit ]
+[ / ] --> [ \[action\] index ]
+[ / ] --> [ \[action\] root ]
+[ / ] --> [ \[action\] view ]
+[ / ] --> [ \[action\] view_user ]
+...
diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm
new file mode 100644
index 0000000..49f7db5
--- /dev/null
+++ b/t/lib/TestApp.pm
@@ -0,0 +1,8 @@
+package TestApp;
+
+use Catalyst::Runtime '5.70';
+use parent 'Catalyst';
+
+__PACKAGE__->setup;
+
+1;
diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm
new file mode 100644
index 0000000..0d44865
--- /dev/null
+++ b/t/lib/TestApp/Controller/Root.pm
@@ -0,0 +1,16 @@
+package TestApp::Controller::Root;
+use parent Catalyst::Controller;
+
+__PACKAGE__->config->{namespace} = '';
+
+sub root : Chained('/') PathPart() CaptureArgs(0) { }
+
+sub index : Chained('root') PathPart('') Args(0) { }
+
+sub view : Chained('root') PathPart('view') Args(1) { }
+
+sub view_user : Chained('root') PathPart('view/user') Args(1) { }
+
+sub edit : Chained('root') PathPart('edit') Args(1) { }
+
+1;