Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Mark Leighton Fisher
January 19, 2005, 2:10 pm
rate this thread
DBI with Test::MockObject::Extends. It is a testing module, so it
belongs in Test::. It uses Test::MockObject, but does not subclass
Test::MockObject (HAS-A Test::MockObject), so MockDBI is probably the
right choice for the second-level name, as it is a testing module that
mocks the DBI.
Test::MockDBI allows you to modify the DBI's behavior however you
choose by creating rules for the DBI's behavior, where the rules can be
sensitive to what SQL is being processed and what DBI testing mode(s)
you choose. This is an improvement over DBD::Mock or DBI::trace(), as
you can change the behavior as well as never having to hit an actual
database (unless you want to).
The advantage of using Test::MockObject::Extends for testing the DBI
with Test::MockDBI is that Test::MockDBI can be used to test programs
that use DBI without changing the base code of the program -- the
Test::MockDBI code can be added without the rest of the program even
having to know about Test::MockDBI (very handy for us consultants).
Test::MockDBI is listed as alpha, because although the code I have
written so far is probably beta or release quality, I have not
mocked-up the whole DBI interface yet -- just the pieces I needed.
Test-MockDBI-0.50 will soon be available from CPAN at:
(as I just uploaded it a few minutes ago).
Mark Leighton Fisher firstname.lastname@example.org
"Reality is that which, when you stop believing
in it, does not go away." Philip K. Dick
- » XML::Simple doesn't handle </tag> shorthand notation??
- — Previous thread in » PERL Modules Announcements