make t/04 to t/10 pass.
Marcus Ramberg [Wed, 30 Mar 2005 08:30:22 +0000 (08:30 +0000)]
t/04plainaction.t
t/05regexaction.t
t/06parameters.t
t/07arguments.t
t/08headers.t
t/09cookies.t
t/10forward.t

index 6ca8e81..ed448db 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c ) = @_;
-        $c->res->output('bar');
-    }
-);
+sub foo : Global {
+    my ( $self, $c ) = @_;
+    $c->res->output('bar');
+}
+
+__PACKAGE__->setup;
 
 package main;
 
index 142eeea..212c193 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    '/foo/(.*)/' => sub {
+sub testregex : Regex(foo/(.*)) {
         my ( $self, $c ) = @_;
         $c->res->output( $c->req->snippets->[0] );
-    }
-);
+}
+
+__PACKAGE__->setup();
 
 package main;
 
index 2465ddc..6e3e4ef 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c ) = @_;
-        $c->res->output( $c->req->params->{foo} );
-    }
-);
+sub foo : Global {
+    my ( $self, $c ) = @_;
+    $c->res->output( $c->req->params->{foo} );
+}
+
+__PACKAGE__->setup;
 
 package main;
 
index e4c76cf..51b5310 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c, $arg ) = @_;
-        $c->res->output($arg);
-    }
-);
+sub foo : Global {
+    my ( $self, $c, $arg ) = @_;
+    $c->res->output($arg);
+}
+
+__PACKAGE__->setup;
 
 package main;
 
index 70288f9..8063060 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c ) = @_;
-        $c->res->headers->header( 'X-Foo' => 'Bar' );
-    }
-);
+sub foo : Global {
+  my ( $self, $c ) = @_;
+  $c->res->headers->header( 'X-Foo' => 'Bar' );
+}
+
+__PACKAGE__->setup;
 
 package main;
 
index 833f28a..fa4171a 100644 (file)
@@ -2,12 +2,12 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c ) = @_;
-        $c->res->cookies->{foo} = { value => 'bar' };
-    }
-);
+sub foo : Global {
+  my ( $self, $c ) = @_;
+  $c->res->cookies->{foo} = { value => 'bar' };
+}
+
+__PACKAGE__->setup;
 
 package main;
 
index 934c058..3920e03 100644 (file)
@@ -2,16 +2,16 @@ package TestApp;
 
 use Catalyst qw[-Engine=Test];
 
-__PACKAGE__->action(
-    foo => sub {
-        my ( $self, $c ) = @_;
-        $c->forward('bar');
-    },
-    bar => sub {
-        my ( $self, $c, $arg ) = @_;
-        $c->res->output($arg);
-    }
-);
+sub foo : Global {
+    my ( $self, $c ) = @_;
+    $c->forward('bar');
+}
+sub bar : Global {
+    my ( $self, $c, $arg ) = @_;
+    $c->res->output($arg);
+}
+
+__PACKAGE__->setup;
 
 package main;