File: dead_load_multiple_chained_attributes.t

package info (click to toggle)
libcatalyst-perl 5.7014-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,276 kB
  • ctags: 874
  • sloc: perl: 11,270; makefile: 48
file content (31 lines) | stat: -rw-r--r-- 548 bytes parent folder | download
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
30
31
#!perl

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 $@;