runner

package
v0.0.0-...-ee2d30e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSuccessfully

func RunSuccessfully() types.GomegaMatcher

RunSuccessfully matches successful execution of a command

func RunSuccessfullyWithOutputString

func RunSuccessfullyWithOutputString(outputMatchers ...types.GomegaMatcher) types.GomegaMatcher

RunSuccessfullyWithOutputString matches successful execution of a command and passes the output string to another matcher (the string will include stdout and stderr)

func RunSuccessfullyWithOutputStringLines

func RunSuccessfullyWithOutputStringLines(outputMatchers ...types.GomegaMatcher) types.GomegaMatcher

RunSuccessfullyWithOutputStringLines matches successful execution of a command and passes the output string to another matcher split into lines (the string will include stdout and stderr)

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

Cmd holds definition of a command

func NewCmd

func NewCmd(execPath string) Cmd

NewCmd constructs a new command

func (Cmd) Run

func (c Cmd) Run() *gexec.Session

Run the command and wait for it to return

func (Cmd) Start

func (c Cmd) Start() *gexec.Session

Start the command and returns underlying session

func (Cmd) String

func (c Cmd) String() string

NewCmd presents a the command as a string; each argument is quoted, so that the command can be copied and called from a shell

func (Cmd) WithArgs

func (c Cmd) WithArgs(args ...string) Cmd

WithArgs returns a copy of the command with new arguments

func (Cmd) WithCleanEnv

func (c Cmd) WithCleanEnv() Cmd

WithCleanEnv returns a copy of the command with all environment variables reset (including OS environment variables)

func (Cmd) WithEnv

func (c Cmd) WithEnv(env ...string) Cmd

WithEnv returns a copy of the command with new environment variables

func (Cmd) WithStdin

func (c Cmd) WithStdin(stdin io.Reader) Cmd

WithStdin returns a copy of the command with Stdin set

func (Cmd) WithTimeout

func (c Cmd) WithTimeout(timeout time.Duration) Cmd

WithTimeout returns a copy of the command with new timeout value

func (Cmd) WithoutArg

func (c Cmd) WithoutArg(arg, val string) Cmd

WithoutArg removes an existing argument

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL