exec

package
v0.0.0-...-62f60b2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expectations

type Expectations struct {
	ExitCode *int
	Stdout   *string
	Stderr   *string
}

type TestCase

type TestCase struct {
	Desc         string
	Expectations Expectations
	// contains filtered or unexported fields
}

func Cmd

func Cmd(command *osexec.Cmd, description ...string) *TestCase

func Run

func Run(command string, description ...string) *TestCase

func (*TestCase) Action

func (tc *TestCase) Action() string

func (*TestCase) Describe

func (tc *TestCase) Describe(description string) *TestCase

func (*TestCase) Description

func (tc *TestCase) Description() string

func (*TestCase) Execute

func (tc *TestCase) Execute(t *testing.T) (mt.TestResult, error)

func (*TestCase) ExpectExitCode

func (tc *TestCase) ExpectExitCode(code int) *TestCase

func (*TestCase) ExpectStderr

func (tc *TestCase) ExpectStderr(stderr string) *TestCase

func (*TestCase) ExpectStdout

func (tc *TestCase) ExpectStdout(stdout string) *TestCase

func (*TestCase) Target

func (tc *TestCase) Target() string

func (*TestCase) WithArgs

func (tc *TestCase) WithArgs(args ...string) *TestCase

func (*TestCase) WithEnvVars

func (tc *TestCase) WithEnvVars(env map[string]string) *TestCase

func (*TestCase) WithStdin

func (tc *TestCase) WithStdin(stdin io.Reader) *TestCase

func (*TestCase) WithWorkingDir

func (tc *TestCase) WithWorkingDir(dir string) *TestCase

type TestContext

type TestContext struct {
	Environment []string
}

func DefaultContext

func DefaultContext() *TestContext

func NewTestContext

func NewTestContext() *TestContext

func (*TestContext) Cmd

func (tc *TestContext) Cmd(cmd *osexec.Cmd, description ...string) *TestCase

func (*TestContext) Run

func (tc *TestContext) Run(command string, description ...string) *TestCase

func (*TestContext) WithEnvVars

func (c *TestContext) WithEnvVars(env map[string]string) *TestContext

func (*TestContext) WithInheritedEnvironment

func (c *TestContext) WithInheritedEnvironment(inherit bool) *TestContext

type TestResult

type TestResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
	// contains filtered or unexported fields
}

func (*TestResult) Errors

func (r *TestResult) Errors() []error

func (*TestResult) TestCase

func (r *TestResult) TestCase() mt.TestCase

Jump to

Keyboard shortcuts

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