Documentation
¶
Overview ¶
Package exectest provides a scripted exec.Runner for unit tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
// Fallback handles commands no rule matches. By default it fails the
// call with an "unexpected command" error.
Fallback func(exec.Cmd) (exec.Result, error)
// contains filtered or unexported fields
}
Fake is an exec.Runner that replays scripted results and records calls. Rules are matched by executable name and argument prefix; the most recently added matching rule wins.
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
Stub configures the reply for one rule.
func (*Stub) Fail ¶
Fail makes the rule exit with code and the given stderr, returned as an *exec.ExitError like the real runner.