exec

package
v0.0.0-...-ba0d244 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package exec mocks running commands. The mocks are used for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBackend

func SetBackend(backend ExecBackend)

Types

type Cmd

type Cmd interface {
	Output() ([]byte, error)
}

func Command

func Command(name string, args ...string) Cmd

type ExecBackend

type ExecBackend func(name string, args ...string) Cmd

func Backend

func Backend() ExecBackend

type MockCommand

type MockCommand struct {
	// contains filtered or unexported fields
}

func NewMockCommand

func NewMockCommand(results ...*MockResult) *MockCommand

func (*MockCommand) Output

func (c *MockCommand) Output() ([]byte, error)

type MockResult

type MockResult struct {
	Stdout []byte
	Err    error
}

func NewMockResult

func NewMockResult(stdout string, err error) *MockResult

Jump to

Keyboard shortcuts

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