in reply to Test::MockDBI example [SOLVED]
If you want to mock your DbLibTry class instead of DBI, as you also seem to want to do, you could look into something like Test::MockObject (which Test::MockDBI happens to use).
Also, note that you're not really doing anything with your $mock_dbi object. You'd probably need a way to inject it into your DbLibTry object for it to take effect (like maybe $dblibtry->{dbh} = $mock_dbi;?). (Untested, and the Test::MockDBI documentation is a little lacking so I'm not completely sure.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test::MockDBI example
by brilant_blue (Beadle) on Feb 09, 2015 at 18:26 UTC | |
|
Re^2: Test::MockDBI example
by brilant_blue (Beadle) on Feb 10, 2015 at 04:24 UTC | |
by Anonymous Monk on Feb 10, 2015 at 08:29 UTC | |
by brilant_blue (Beadle) on Feb 10, 2015 at 09:13 UTC |