Documentation
¶
Index ¶
- type Expectations
- type TestCase
- func (tc *TestCase) Action() string
- func (tc *TestCase) Describe(description string) *TestCase
- func (tc *TestCase) Description() string
- func (tc *TestCase) Execute(t *testing.T) (mt.TestResult, error)
- func (tc *TestCase) ExpectExitCode(code int) *TestCase
- func (tc *TestCase) ExpectStderr(stderr string) *TestCase
- func (tc *TestCase) ExpectStdout(stdout string) *TestCase
- func (tc *TestCase) Target() string
- func (tc *TestCase) WithArgs(args ...string) *TestCase
- func (tc *TestCase) WithEnvVars(env map[string]string) *TestCase
- func (tc *TestCase) WithStdin(stdin io.Reader) *TestCase
- func (tc *TestCase) WithWorkingDir(dir string) *TestCase
- type TestContext
- type TestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expectations ¶
type TestCase ¶
type TestCase struct { Desc string Expectations Expectations // contains filtered or unexported fields }
func (*TestCase) Description ¶
func (*TestCase) ExpectExitCode ¶
func (*TestCase) ExpectStderr ¶
func (*TestCase) ExpectStdout ¶
func (*TestCase) WithWorkingDir ¶
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
Click to show internal directories.
Click to hide internal directories.