test case for reported stash issue to prevent regressions
John Napiorkowski [Wed, 25 Mar 2015 16:38:20 +0000 (11:38 -0500)]
t/no_test_stash_bug.t [new file with mode: 0644]

diff --git a/t/no_test_stash_bug.t b/t/no_test_stash_bug.t
new file mode 100644 (file)
index 0000000..72549df
--- /dev/null
@@ -0,0 +1,28 @@
+use warnings;
+use strict;
+
+# For reported: https://rt.cpan.org/Ticket/Display.html?id=97948
+
+{
+  package MyApp::Controller::Root;
+  $INC{'MyApp/Controller/Root.pm'} = __FILE__;
+
+  use base 'Catalyst::Controller';
+
+  sub example :Local Args(0) {
+    pop->stash->{testing1} = 'testing2';
+  }
+
+  package MyApp;
+  use Catalyst;
+
+  MyApp->setup;
+}
+
+use Test::More;
+use Catalyst::Test 'MyApp';
+
+my ($res, $c) = ctx_request('/root/example');
+is $c->stash->{testing1}, 'testing2', 'got expected stash value';
+
+done_testing;