-
Notifications
You must be signed in to change notification settings - Fork 133
Closed
Description
Any tip on how to mock a command execution for testing?
I tried the trick from here: https://npf.io/2015/06/testing-exec-command/ but it's not working properly
// cmd.go tweak
var ComandExecuter = exec.Command
func (c *Cmd) run() {
defer func() {
c.statusChan <- c.Status() // unblocks Start if caller is waiting
close(c.doneChan)
}()
// //////////////////////////////////////////////////////////////////////
// Setup command
// //////////////////////////////////////////////////////////////////////
cmd := ComandExecuter(c.Name, c.Args...)
Metadata
Metadata
Assignees
Labels
No labels