On Sep 2, 2009, at 10:48 AM, Tomas Doran wrote:
On 1 Sep 2009, at 04:43, fREW Schmidt wrote:
I'd really like to start testing my controllers, and I wished I'd
started sooner, but oh well. The biggest barrier at this point is
the login system. It uses OpenID for auth, which is where the
hard stuff comes from.

Why bother with the complexity when testing if it isn't the OpenID
stuff your testing specifically.

I'd arrange for the relevant tests to supply a custom config file
(I do this by mangling MYAPP_CONFIG env variable in the tests,
although I'm sure there are more elegant solutions)..
This is what I've adopted. I have "permanent" config in myapp.yml and
then whatever site customization in myapp_local.yml and then a
configuration file specifically for testing (substituting DB config
normally) myapp_test.yml

And then a test like:

use strict;
use warnings;
use Test::More "no_plan";
use Test::WWW::Mechanize::Catalyst;
# etc...

That will pick up the right config and override your core stuff where
needed/desired. I don't know if this is a widespread practice but
I've been doing it for a long time now and really like it.


Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 6 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 1, '09 at 3:43a
activeSep 3, '09 at 7:38p



site design / logo © 2021 Grokbase