exectest

package
v0.0.0-...-9f1a7a8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package exectest provides fake implementations of the exec package.

These implementations can be used to mock out the Executor in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorExecutor

type ErrorExecutor struct {
	FakeExecutor
	Err error
}

func (*ErrorExecutor) Execute

func (e *ErrorExecutor) Execute(opts exec.ExecuteOptions) error

type FailLaterExecutor

type FailLaterExecutor struct {
	FakeExecutor

	Succeeds int64
	// contains filtered or unexported fields
}

FailLaterExecutor is the opposite of RetryExecutor. It fails after N Succeeds.

func (*FailLaterExecutor) Execute

func (e *FailLaterExecutor) Execute(opts exec.ExecuteOptions) error

type FakeExecutor

type FakeExecutor struct {
	Output map[string][][]byte
	// contains filtered or unexported fields
}

func (*FakeExecutor) Execute

func (e *FakeExecutor) Execute(opts exec.ExecuteOptions) error

func (*FakeExecutor) ExecutedCmd

func (e *FakeExecutor) ExecutedCmd(cmd string, args []string) bool

func (*FakeExecutor) GetCommands

func (e *FakeExecutor) GetCommands(cmdName string) []command

type RetryExecutor

type RetryExecutor struct {
	FakeExecutor

	// How many times will it fail before succeeding?
	Failures int64
	// contains filtered or unexported fields
}

RetryExecutor succeeds after N failures.

func (*RetryExecutor) Execute

func (e *RetryExecutor) Execute(opts exec.ExecuteOptions) error

Jump to

Keyboard shortcuts

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