Why should I want to mock my DbLibTry class?
Mocking DbLibTry::get_all_songs() is what you seem to be asking for when you write $mock_dbi->set_retval( method => 'get_all_songs', ...
I just want to mock all connections to a database.
Then you should be replacing your real DBI object with the fake one, as suggested earlier, something like $dblibtry->{dbh} = $mock_dbi; - and in this case of course you shouldn't call your connect, or you'll get a real DBI object.
In reply to Re^3: Test::MockDBI example
by Anonymous Monk
in thread Test::MockDBI example [SOLVED]
by brilant_blue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |