Run satisfies Runnable
()
| 121 | |
| 122 | // Run satisfies Runnable |
| 123 | func (s *commandStub) Run() error { |
| 124 | if s.exitStatus != 0 { |
| 125 | // It's nontrivial to construct a fake `exec.ExitError` instance, so we return an error type |
| 126 | // that has the `ExitCode() int` method. |
| 127 | return errWithExitCode{ |
| 128 | message: fmt.Sprintf("%s exited with status %d", s.pattern, s.exitStatus), |
| 129 | exitCode: s.exitStatus, |
| 130 | } |
| 131 | } |
| 132 | return nil |
| 133 | } |
| 134 | |
| 135 | // Output satisfies Runnable |
| 136 | func (s *commandStub) Output() ([]byte, error) { |