Re: [Catalyst] Model Testing Problems.

2011-09-05 Thread Eden Cardim
 John == John Karr brain...@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 Monkeyhttp://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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Model Testing Problems.

2011-09-05 Thread John Karr
Thanks Eric  -- I had found and posted the solution when the mailing list 
server was behaving erratically and people may have missed the message.

When I set the problem aside and looked at it after a few days my mistake was 
obvious.  

http://lists.scsys.co.uk/pipermail/catalyst/2011-August/027503.html 


-Original Message-
From: Eden Cardim [mailto:edencar...@gmail.com] 
Sent: Monday, September 05, 2011 7:38 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Model Testing Problems.

..

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.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/