From: Marcus Ramberg Date: Wed, 30 Mar 2005 08:30:22 +0000 (+0000) Subject: make t/04 to t/10 pass. X-Git-Tag: 5.7099_04~1652 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dea8ff68a7552057e3850b2a1ebc4f2190c769af;hp=bea4160a7769e77996d8a820fc2602bd3f0f9029;p=catagits%2FCatalyst-Runtime.git make t/04 to t/10 pass. --- diff --git a/t/04plainaction.t b/t/04plainaction.t index 6ca8e81..ed448db 100644 --- a/t/04plainaction.t +++ b/t/04plainaction.t @@ -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; diff --git a/t/05regexaction.t b/t/05regexaction.t index 142eeea..212c193 100644 --- a/t/05regexaction.t +++ b/t/05regexaction.t @@ -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; diff --git a/t/06parameters.t b/t/06parameters.t index 2465ddc..6e3e4ef 100644 --- a/t/06parameters.t +++ b/t/06parameters.t @@ -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; diff --git a/t/07arguments.t b/t/07arguments.t index e4c76cf..51b5310 100644 --- a/t/07arguments.t +++ b/t/07arguments.t @@ -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; diff --git a/t/08headers.t b/t/08headers.t index 70288f9..8063060 100644 --- a/t/08headers.t +++ b/t/08headers.t @@ -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; diff --git a/t/09cookies.t b/t/09cookies.t index 833f28a..fa4171a 100644 --- a/t/09cookies.t +++ b/t/09cookies.t @@ -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; diff --git a/t/10forward.t b/t/10forward.t index 934c058..3920e03 100644 --- a/t/10forward.t +++ b/t/10forward.t @@ -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;