Catalyst's run
method would actually run the HTTP server (via Plack/PSGI!) for a development, which is not what you want with testing via PSGI (without running a server). You need: app => MyApp->psgi_app
, without an extra sub
block, since psgi_app
supposedly returns the PSGI app itself.
The error message "Can't call method 'request' on ..." is a common error when your app returns something that is not correct per PSGI spec. The message has been improved a bit on the git master, but it's essentially a user error since you're basically returning sub { $app }
when it expects just $app
.
More documentation on the PSGI support with Catalyst is available with perldoc Catalyst::PSGI
.