File: dead_load_multiple_chained_attributes.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use strict;
use warnings;
use lib 't/lib';

use Test::More;

plan tests => 4;

use Catalyst::Test 'TestApp';

eval q{
    package TestApp::Controller::Action::Chained;
    sub should_fail : Chained('/') Chained('foo') Args(0) {}
};
ok(!$@);

eval { TestApp->setup_actions; };
ok($@, 'Multiple chained attributes make action setup fail');

eval q{
    package TestApp::Controller::Action::Chained;
    no warnings 'redefine';
    sub should_fail {}
};
ok(!$@);

eval { TestApp->setup_actions };
ok(!$@, 'And ok again') or warn $@;