Documentation ¶
Overview ¶
Copied from MIT licensed https://github.com/rendon/testcli
Index ¶
- type Command
- func (c *Command) Error() error
- func (c *Command) Failure() bool
- func (c *Command) SendInterrupt()
- func (c *Command) SetEnv(env []string)
- func (c *Command) SetStdin(stdin io.Reader)
- func (c *Command) Start()
- func (c *Command) Stderr() string
- func (c *Command) StderrContains(str string) bool
- func (c *Command) StderrMatches(regex string) bool
- func (c *Command) Stdout() string
- func (c *Command) StdoutContains(str string) bool
- func (c *Command) StdoutMatches(regex string) bool
- func (c *Command) Success() bool
- func (c *Command) Wait()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is typically constructed through the Command() call and provides state to the execution engine.
func (*Command) SendInterrupt ¶
func (c *Command) SendInterrupt()
func (*Command) SetEnv ¶
SetEnv overwrites the environment with the provided one. Otherwise, the parent environment will be supplied.
func (*Command) SetStdin ¶
SetStdin sets the stdin stream. It makes no attempt to determine if the command accepts anything over stdin.
func (*Command) StderrContains ¶
StderrContains determines if command's STDERR contains `str`, this operation is case insensitive.
func (*Command) StderrMatches ¶
StderrMatches compares a regex to the stderr produced by the command.
func (*Command) StdoutContains ¶
StdoutContains determines if command's STDOUT contains `str`, this operation is case insensitive.
func (*Command) StdoutMatches ¶
StdoutMatches compares a regex to the stdout produced by the command.