added Test::Pod support
[catagits/Catalyst-Runtime.git] / t / 12stash.t
diff --git a/t/12stash.t b/t/12stash.t
new file mode 100644 (file)
index 0000000..019b699
--- /dev/null
@@ -0,0 +1,29 @@
+package TestApp;
+
+use Catalyst qw[-Engine=Test];
+
+__PACKAGE__->action(
+    foo => sub {
+        my ( $self, $c ) = @_;
+        $c->stash->{test} ||= 'foo';
+        $c->forward('bar');
+    },
+    bar => sub {
+        my ( $self, $c ) = @_;
+        $c->stash->{test} ||= 'bar';
+        $c->forward('yada');
+    },
+    yada => sub {
+        my ( $self, $c ) = @_;
+        $c->stash->{test} ||= 'yada';
+        $c->res->output( $c->stash->{test} );
+    }
+);
+
+package main;
+
+use Test::More tests => 2;
+use Catalyst::Test 'TestApp';
+
+ok( get('/foo') =~ /foo/ );
+ok( get('/bar') =~ /bar/ );