5 use Test::More tests => 6;
7 use Catalyst::Test 'TestApp';
10 package TestApp::Controller::Action::Chained;
11 sub should_fail : Chained('should_fail') Args(0) {}
15 eval { TestApp->setup_actions; };
16 like($@, qr|Actions cannot chain to themselves registering /action/chained/should_fail|,
17 'Local self referencing attributes makes action setup fail');
20 package TestApp::Controller::Action::Chained;
21 no warnings 'redefine';
23 use warnings 'redefine';
24 sub should_also_fail : Chained('/action/chained/should_also_fail') Args(0) {}
28 eval { TestApp->setup_actions };
29 like($@, qr|Actions cannot chain to themselves registering /action/chained/should_also_fail|,
30 'Full path self referencing attributes makes action setup fail');
33 package TestApp::Controller::Action::Chained;
34 no warnings 'redefine';
35 sub should_also_fail {}
39 eval { TestApp->setup_actions };
40 ok(!$@, 'And ok again') or warn $@;