
moseley at hank
Feb 6, 2010, 3:09 PM
Post #2 of 3
(716 views)
Permalink
|
|
Re: Run catalyst tests against another database
[In reply to]
|
|
On Sat, Feb 6, 2010 at 2:01 PM, John Atzger <jatzger [at] hotmail> 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 moseley [at] hank
|