app_is_non_plack();
plack_app_return();
+plack_streaming_app_return();
broken_route_def();
array_with_sub();
array_with_no_sub();
"when a route returns a thing that look like a Plack app, the web app redispatches to that thing";
}
+sub plack_streaming_app_return {
+ {
+
+ package FauxPlackStreamApp;
+ sub new { bless {}, $_[0] }
+
+ sub to_app {
+ return sub {
+ return sub {
+ my $responder = shift;
+ $responder->([ 999, [], ["foo"] ]);
+ };
+ };
+ }
+ }
+
+ @dispatch = (
+ sub (/) {
+ FauxPlackStreamApp->new;
+ }
+ );
+
+ my $get = run_request( GET => 'http://localhost/' );
+
+ cmp_ok $get->code, '==', 999,
+ "when a route returns a thing that look like a Plack Streaming app, the web app redispatches to that thing";
+}
+
sub broken_route_def {
@dispatch = ( '/' => "" );