Documentation
¶
Overview ¶
Package executiltest provides a scripted executil.Executor test double.
Index ¶
- type Call
- type Exec
- func (e *Exec) Calls() []Call
- func (e *Exec) Run(_ context.Context, cmd string, args ...string) ([]byte, error)
- func (e *Exec) RunDir(_ context.Context, dir, cmd string, args ...string) ([]byte, error)
- func (e *Exec) RunDirStream(_ context.Context, dir string, stdout, stderr io.Writer, cmd string, ...) error
- func (e *Exec) RunOutput(_ context.Context, cmd string, args ...string) ([]byte, []byte, error)
- func (e *Exec) RunStream(_ context.Context, stdout, stderr io.Writer, cmd string, args ...string) error
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exec ¶
type Exec struct {
Responses []Response
// contains filtered or unexported fields
}
Exec is a scripted executil.Executor: every invocation records a Call and consumes the next Response (zero-value results once the script runs out, so an unscripted Exec is a silent no-op stub). It also implements the optional RunOutput seam for separated stdout/stderr. Safe for concurrent use.
func (*Exec) RunDirStream ¶
func (e *Exec) RunDirStream(_ context.Context, dir string, stdout, stderr io.Writer, cmd string, args ...string) error
RunDirStream behaves like RunStream and records the directory.
Click to show internal directories.
Click to hide internal directories.