[Catalyst] Model Testing Problems.

Eden Cardim edencardim at gmail.com
Mon Sep 5 11:37:44 GMT 2011


>>>>> "John" == John Karr <brainbuz at brainbuz.org> writes:

    John> I have a catalyst application that I've been working on for
    John> some time (it is pretty big now), and am finally trying to
    John> write tests for it. The application runs error free when run
    John> in its entirety. But I can't get Model Tests to run. My Model
    John> is DBI based, where each DSN has a MyApp::Model::DSN parent
    John> module and then there are MyApp::Model::DSN::Table child
    John> modules which contain the methods relevant to each table. I
    John> would like to access my model methods in a manner similar to
    John> how I do in an application:
 
    John>  is( $BoPeep->model('DBI::Flock')->CountSheep(), 3 , 'CountSheep. There are 3 sheep in BoPeeps flock' ) ; 

use MyApp;
is( MyApp->model('DBI::Flock')->CountSheep(), 3 , 'CountSheep. There are 3 sheep in BoPeeps flock' ) ;

The above snippet should work, assuming the CountSheep() method is in place.

-- 
  Eden Cardim
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://blog.edencardim.com/            http://www.shadowcat.co.uk/servers/
http://twitter.com/#!/edenc



More information about the Catalyst mailing list