Actually add the plugin, and remove the TODO item
Tomas Doran [Sun, 21 Dec 2008 20:30:55 +0000 (20:30 +0000)]
TODO
t/lib/TestAppPluginWithNewMethod.pm [new file with mode: 0644]

diff --git a/TODO b/TODO
index 54434f9..7a0c003 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,9 +6,6 @@ Pending patches:
 
 Back-compat investigation / konwon issues:
 
-  - Find out why C::P::A's test suite causes the 'stack' attributes
-    default method to not be called. (new not being run??)
-
   - Common engine test failures, look into and get tests into core.
 
   - CatalystX-Imports, Class::MOP doesn't consider anon subs in the symbol 
diff --git a/t/lib/TestAppPluginWithNewMethod.pm b/t/lib/TestAppPluginWithNewMethod.pm
new file mode 100644 (file)
index 0000000..778f63d
--- /dev/null
@@ -0,0 +1,29 @@
+{
+    package NewTestPlugin;
+    use strict;
+    use warnings;
+    sub new { 
+        my $class = shift;
+        return bless $_[0], $class; 
+    }
+}
+
+{
+    package TestAppPluginWithNewMethod;
+    use Test::Exception;
+    use Catalyst qw/+NewTestPlugin/;
+
+    sub foo : Local {
+        my ($self, $c) = @_;
+        $c->res->body('foo');
+    }
+
+    use Moose; # Just testing method modifiers still work.
+    __PACKAGE__->setup;
+    our $MODIFIER_FIRED = 0;
+
+    lives_ok {
+        before 'dispatch' => sub { $MODIFIER_FIRED = 1 }
+    } 'Can apply method modifier';
+    no Moose;
+}