Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Recently, while writing unit test file for a perl module ( .t file ) I came across a situation where I need to mock a system() call being used in the perl module ( for which this test file is being written ).This system() call is running some c++ code which makes a connectivity with the database.
My requirement is that the unit test file should be free from any kind of connectivity from external system ( i.e. DB connectivity here ) and I want to get the return value of this system command as 0 without actually running the command.
Is there any way I can mock system() call using any of existing Test::.. perl modules ?
Comment on Mocking system() call in Unit Test File for a Perl Module