03 Mar 2013 12:59:46 UTC
- Distribution: Test-MockCommand
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (453 / 58 / 0)
- KwaliteeBus factor: 0
- 94.12% Coverage
- License: unknown
- Activity24 month
- Download (20.77KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userKYZ Stuart Caieand 1 contributors
- Stuart Caie
Test::MockCommand::TiedFH - emulate open() filehandle
This class pretends to be an open() filehandle to and/or from a pipe. It is either in recording mode or playback mode. It acts on a result object, and in recording mode it also uses an open filehandle to the real command.
In recording mode, it passes through read/write requests to the filehandle and appends the result to the result object before returning to the calling code.
In playback mode, it returns data exclusively from the result object and emulates the results the real file operations would give.
In some situations, two commands will be identical in invocation except for their input and output. The MockCommand framework handles this by passing control to the first result in the database, but giving it a list of all the other results.
If input is provided, we use all input we currently have and compare it to all the other results. If we find a unique match, we switch to using this result object.
Module Install Instructions
To install Test::MockCommand, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Test::MockCommand
For more information on module installation, please visit the detailed CPAN module installation guide.