Closed chrismytton closed 11 years ago
I'd certainly rather leave mySociety::Config alone to simply read in the config as it does (so no need to touch commonlib), and for everywhere in the code to use FixMyStreet->config (currently 36 mySociety::Config in perllib, 52 FixMyStreet->config, so it'll presumably just be hangovers and should be easy to swap). Then a generic override would only be needed in the FixMyStreet test code and presumably could be based on that Zurich code.
Done in 94ac7786132a538a5742ba325eb7fe9eff89cfc9. Called by (actual code):
FixMyStreet::override_config {
MAPIT_TYPES => [ 'O01' ]
}, sub {
# ... code ...
};
Currently the tests depend on certain settings in
conf/general.yml
being correct before they will pass.It would be good if we could have a generic method that allowed you to override certain parts of the config within the tests. There is already a more specific version of this in the Zurich cobrand's tests.
It would potentially work something like (pseudo-code):
Relevant IRC discussion with @evdb
and