stubs

package
v0.0.0-...-6f3d572 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OSGetwd is a stub for os.Getwd
	OSGetwd = os.Getwd

	// Run is a wrapper `exec.Cmd` used for stubbing purposes.
	Run = func(cmd *exec.Cmd) error {
		return cmd.Run()
	}

	// StubStdinPipe stubs the cmd.StdinPipe method (used for testing purposes)
	StubStdinPipe = func(cmd *exec.Cmd) (io.WriteCloser, error) {
		return cmd.StdinPipe()
	}
)

Functions

func StubEnv

func StubEnv(t *testing.T, m map[string]string)

StubEnv stubs the environment variable used throughout this package.

func StubGetwd

func StubGetwd(t *testing.T, wd string, err error)

StubGetwd uses the provided string and error when calling command.GetwdProcessor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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