[Pdx-pm] interesting testing hole thats been dug

benh ben.hengst at gmail.com
Tue Jan 2 16:36:12 PST 2007

A co-worker and I are wondering how/what the best way around this is?

we have a module that cans up all our DB connections... but when I
want to test it should be a mocDB object... so we now have a DBTest
that builds out the mocDB stuffies. But the issue now is that to get
all the existing scripts to use DBTest for our tests.

Is there a clean way to intercept DB calls? is there some kinda bubble
that we can toss the scripts in to and then any call out gets
redirected? Our inital though was to just set an env var and then when
the script would run then it would pick the right object, but that
requires selecting a use statement (ie if($ENV{test}){use DBTest; }
else {use DBHost;} ) alas that doesn't work.... any other ideas?


More information about the Pdx-pm-list mailing list