r12983@zaphod: kd | 2008-04-28 18:10:27 +1000
[catagits/Catalyst-Runtime.git] / t / dead_load_multiple_chained_attributes.t
diff --git a/t/dead_load_multiple_chained_attributes.t b/t/dead_load_multiple_chained_attributes.t
new file mode 100644 (file)
index 0000000..7d1ad34
--- /dev/null
@@ -0,0 +1,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 $@;
+