[Catalyst] getting $c in model unit test

Nathan Gray kolibrie at graystudios.org
Tue May 15 14:48:05 GMT 2007


I would like to test a model with a unit test.  Catalyst kindly
generates stub unit tests for models, but it does not include a stub
showing how to instantiate the context object.

I have looked at:

  - http://dev.catalystframework.org/wiki/Testing#ModelTests
    (Examples of test for your model: STUB)
  - http://search.cpan.org/dist/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Testing.pod
    (TIP: For unit tests vs. the "full application tests" approach used
  by Test::WWW::Mechanize::Catalyst, see Catalyst::Test.)
  - http://search.cpan.org/perldoc?Catalyst%3A%3ATest
    (METHODS: get request local_request remote_request)
  - http://search.cpan.org/perldoc?Catalyst%3A%3ADevel
    (The documentation remains with Catalyst::Runtime.)
  - http://search.cpan.org/perldoc?Catalyst%3A%3ARuntime
    ($c->prepare( @arguments ) Creates a Catalyst context from an engine-specific request (Apache, CGI, etc.).)

Does anyone have an example unit test that has access to $c?

Thanks so much!

-kolibrie

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070515/be7cbfeb/attachment.pgp


More information about the Catalyst mailing list