From: Marcus Ramberg Date: Wed, 30 Mar 2005 09:26:13 +0000 (+0000) Subject: fixed 12, 50% on 13/14 - 15 converted, but not working. X-Git-Tag: 5.7099_04~1651 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a8ed7612b5afccad8cfda4fe1dc8947bda89516d fixed 12, 50% on 13/14 - 15 converted, but not working. --- diff --git a/t/11redirect.t b/t/11redirect.t index ef9e537..8ac6237 100644 --- a/t/11redirect.t +++ b/t/11redirect.t @@ -2,12 +2,12 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - foo => sub { - my ( $self, $c ) = @_; - $c->res->redirect('http://localhost/bar'); - } -); +sub foo : Global { + my ( $self, $c ) = @_; + $c->res->redirect('http://localhost/bar'); +} + +__PACKAGE__->setup; package main; diff --git a/t/12stash.t b/t/12stash.t index 019b699..033c720 100644 --- a/t/12stash.t +++ b/t/12stash.t @@ -2,23 +2,23 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - foo => sub { - my ( $self, $c ) = @_; - $c->stash->{test} ||= 'foo'; - $c->forward('bar'); - }, - bar => sub { +sub foo : Global { + my ( $self, $c ) = @_; + $c->stash->{test} ||= 'foo'; + $c->forward('bar'); +} +sub bar : Global { my ( $self, $c ) = @_; $c->stash->{test} ||= 'bar'; $c->forward('yada'); - }, - yada => sub { +} +sub yada : Global { my ( $self, $c ) = @_; $c->stash->{test} ||= 'yada'; $c->res->output( $c->stash->{test} ); - } -); +} + +__PACKAGE__->setup; package main; diff --git a/t/13default.t b/t/13default.t index ed3ca04..4c5c55c 100644 --- a/t/13default.t +++ b/t/13default.t @@ -2,21 +2,21 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - '!default' => sub { - my ( $self, $c ) = @_; - $c->res->output('bar'); - } -); +sub default : Private { + my ( $self, $c ) = @_; + $c->res->output('bar'); +} + +__PACKAGE__->setup; package TestApp::C::Foo::Bar; -TestApp->action( - '!default' => sub { - my ( $self, $c ) = @_; - $c->res->output('yada'); - } -); +use base 'Catalyst::Base'; + +sub default : Private { + my ( $self, $c ) = @_; + $c->res->output('yada'); +} package main; diff --git a/t/14beginend.t b/t/14beginend.t index 81bd9d9..3e194de 100644 --- a/t/14beginend.t +++ b/t/14beginend.t @@ -2,40 +2,37 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - '!begin' => sub { - my ( $self, $c ) = @_; - $c->res->output('foo'); - }, +sub begin : Private { + my ( $self, $c ) = @_; + $c->res->output('foo'); +} - '!default' => sub { }, +sub default : Private { } - '!end' => sub { - my ( $self, $c ) = @_; - $c->res->output( $c->res->output . 'bar' ); - }, +sub end : Private { + my ( $self, $c ) = @_; + $c->res->output( $c->res->output . 'bar' ); +} -); -package TestApp::C::Foo::Bar; +__PACKAGE__->setup; -TestApp->action( +package TestApp::C::Foo::Bar; - '!begin' => sub { - my ( $self, $c ) = @_; - $c->res->output('yada'); - }, +use base 'Catalyst::Base'; - '!default' => sub { }, +sub begin : Private { + my ( $self, $c ) = @_; + $c->res->output('yada'); +} - '!end' => sub { - my ( $self, $c ) = @_; - $c->res->output('yada'); - $c->res->output( $c->res->output . 'yada' ); - }, +sub default : Private { } -); +sub end : Private { + my ( $self, $c ) = @_; + $c->res->output( $c->res->output . 'yada' ); +} package main; diff --git a/t/15connection.t b/t/15connection.t index 54ead9d..c9a9ac9 100644 --- a/t/15connection.t +++ b/t/15connection.t @@ -2,16 +2,14 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - hostname => sub { - my ( $self, $c ) = @_; - $c->res->output( $c->req->hostname ); - }, - address => sub { - my ( $self, $c ) = @_; - $c->res->output( $c->req->address ); - } -); +sub hostname : Global { + my ( $self, $c ) = @_; + $c->res->output( $c->req->hostname ); +} +sub address : Global { + my ( $self, $c ) = @_; + $c->res->output( $c->req->address ); +} package main;