[Catalyst] Unit Testing

Matt S Trout dbix-class at trout.me.uk
Sun Apr 20 15:21:13 BST 2008


On Sun, Apr 20, 2008 at 12:51:44PM +1000, Yao Wang wrote:
> Hi Everybody,
> 
> Recently, i am looking for some modules for unit testing. I have seen Catalyst::Test, Test::WWW::Mechanize::Catalyst etc, i think they are the testing tools for application, not for unit testing. When i do the unit testing, i need to pass $c and some other params to the methods right ? But how can i create $c for testing ?
> So can anybody tell me how to create this kind of $c ?

Test::MockObject if you really want to.

Personally I think that if you've got enough logic in your controller (as
opposed to your model) to -need- unit testing you're doing something wrong.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list