fakerunner

package
v3.2.9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeResult

type FakeResult struct {
	CLI string
	Dir string
	Env map[string]string
}

FakeResult the expected results

type FakeRunner

type FakeRunner struct {
	// Commands sorted commands
	Commands []*cmdrunner.Command

	// OrderedCommands recorded commands in order
	OrderedCommands []*cmdrunner.Command

	// CommandRunner if specified this callback returns the results and error
	CommandRunner cmdrunner.CommandRunner

	// ResultOutput default output if no CommandRunner
	ResultOutput string

	// ResultError default error output if no CommandRunner
	ResultError error
}

FakeRunner for testing command runners

func (*FakeRunner) ExpectResults

func (f *FakeRunner) ExpectResults(t *testing.T, results ...FakeResult)

Expects expects the given results

func (*FakeRunner) Run

func (f *FakeRunner) Run(c *cmdrunner.Command) (string, error)

Run the default implementation

Jump to

Keyboard shortcuts

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