http://qs1969.pair.com?node_id=11133679


in reply to Re^2: How to syntax-check Catalyst code which throws 'Invalid CODE attributes' errors?
in thread How to syntax-check Catalyst code which throws 'Invalid CODE attributes' errors?

You can do that but I think you’re probably going to be happier testing the application itself instead of components; or testing the components from within the application. Controllers need to have a notion of the Catalyst context. Essentially, they don’t even properly exist except as part of a request dispatch. A controller endpoint cannot naturally do anything outside of that.

What you’re doing is akin to trying to check subs inside a script instead of the script itself. It can be done but it’s weird given the, well, context of the code. Catalyst controllers aren’t code that can be run alone, only within and by the app. Side-note: models and views differ here. Catalyst only adds configuration and access affordances for those.

Catalyst testing is really extremely good and flexible. Only Mojo is better, easier. It doesn’t require any (system, standalone, external) server or special environment or anything.