fixed 12, 50% on 13/14 - 15 converted, but not working.
Marcus Ramberg [Wed, 30 Mar 2005 09:26:13 +0000 (09:26 +0000)]
t/11redirect.t
t/12stash.t
t/13default.t
t/14beginend.t
t/15connection.t

index ef9e537..8ac6237 100644 (file)
@@ -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;
 
index 019b699..033c720 100644 (file)
@@ -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;
 
index ed3ca04..4c5c55c 100644 (file)
@@ -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;
 
index 81bd9d9..3e194de 100644 (file)
@@ -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;
 
index 54ead9d..c9a9ac9 100644 (file)
@@ -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;