7 use Test::More tests => 6;
9 use Catalyst::Test 'TestApp';
12 package TestApp::Controller::Action::Chained;
13 sub should_fail : Chained('should_fail') Args(0) {}
17 eval { TestApp->setup_actions; };
18 like($@, qr|Actions cannot chain to themselves registering /action/chained/should_fail|,
19 'Local self referencing attributes makes action setup fail');
22 package TestApp::Controller::Action::Chained;
23 no warnings 'redefine';
25 use warnings 'redefine';
26 sub should_also_fail : Chained('/action/chained/should_also_fail') Args(0) {}
30 eval { TestApp->setup_actions };
31 like($@, qr|Actions cannot chain to themselves registering /action/chained/should_also_fail|,
32 'Full path self referencing attributes makes action setup fail');
35 package TestApp::Controller::Action::Chained;
36 no warnings 'redefine';
37 sub should_also_fail {}
41 eval { TestApp->setup_actions };
42 ok(!$@, 'And ok again') or warn $@;