[Catalyst] Modify config in a test

Bill Moseley moseley at hank.org
Wed Sep 26 05:24:35 GMT 2012


I'm using Catalyst::Test on an app.

The app has a myapp.yml config which includes configuration for creating an
instance of a Model component -- and part of that Model's config is a
database dsn attribute.   When running my test I do want to have the app
load this config file -- but I want to modify it on-the-fly.

My test builds a SQLite database when it runs, and I'd like to be able to
modify the config as (before) Catalyst creates the instance of the model
component -- that is just filter the config to inject my temporary database.

The model "dsn" attribute is readonly -- otherwise I could just do
MyApp->model( 'MyModel' )->dns( $new_dsn );

What's a good, clean way of doing this?   Or perhaps a better approach all
together?

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120925/01d0b=
ea1/attachment.htm


More information about the Catalyst mailing list