7 use Catalyst::Test 'TestApp';
15 for my $type (qw(Args CaptureArgs)) {
17 package TestApp::Controller::Action::Chained;
18 no warnings 'redefine';
19 sub should_fail : Chained('/') ${type}${fail} {}
23 eval { TestApp->setup_actions };
24 like($@, qr/Invalid \Q${type}${fail}\E/,
25 "Bad ${type}${fail} attribute makes action setup fail");
36 for my $type (qw(Args CaptureArgs)) {
38 package TestApp::Controller::Action::Chained;
39 no warnings 'redefine';
40 sub should_fail : Chained('/') ${type}${ok} {}
43 eval { TestApp->setup_actions };
44 ok(!$@, "${type}${ok} works");
48 for my $first (qw(Args CaptureArgs)) {
49 for my $second (qw(Args CaptureArgs)) {
51 package TestApp::Controller::Action::Chained;
52 no warnings 'redefine';
53 sub should_fail :Chained('/') $first $second {}
56 eval { TestApp->setup_actions };
57 my $msg = $first eq $second
59 : "Combining Args and CaptureArgs";
60 like($@, qr/$msg attributes not supported registering/,
61 "$first + $second attribute makes action setup fail");