in reply to Test::MockDBI example [SOLVED]

$mock_dbi->set_retval( method => 'get_all_songs', retval => \%RET_VALS );

My guess is that that's not doing what you think it's doing. Try putting a print into your sub get_all_songs to see if it's getting called or mocked. See also Basic debugging checklist - print and Data::Dumper are your friends :-)

Replies are listed 'Best First'.
Re^2: Test::MockDBI example
by brilant_blue (Beadle) on Feb 10, 2015 at 04:45 UTC

    I have just added use feature qw(say); and use Data::Dumper; into DbLibTry.pm file.

    It looks like there is true condition $rv == -1 and $DBI::errstr is undef.