On Sat, Feb 6, 2010 at 2:01 PM, John Atzger <[email protected]> wrote:
> I want my Catalyst tests to run against a test database. I wrote this:
>
> package MyApp::Model::DB;
> use strict;
> use base 'Catalyst::Model::DBIC::Schema';
>
> BEGIN {
> require MyApp;
> my $db = $ENV{HARNESS_ACTIVE} ? 'test' : 'myapp';
> my $config = MyApp->config->{database}{$db};
>
> __PACKAGE__->config(
> schema_class => 'MyApp::Schema',
> connect_info => {
> dsn => $config->{dsn},
> user => $config->{user},
> password => $config->{password},
> );
> }
>
> I don't want test information in my code. How do people do this?
>
I use separate config files that get merged into the main config.
--
Bill Moseley
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/