On Sat, Feb 6, 2010 at 2:01 PM, John Atzger <jatz...@hotmail.com> 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 mose...@hank.org
_______________________________________________ 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/