runner is a package that enables testing of functions that use the
os/exec.Command() method for running commands.
By default, runner.New() returns an initialized os/exec.Command(). This
contains the .Run() method that is defined in the Runner interface.
In your tests, you can create a interface with the .Run() method and have it
return errors for negative testing, return nil for positive testing, and even
have it panic to see how your program acts when unrecoverable errors are hit.
Example
See the following files from the devsupport
project.