exec

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package provides wrapper around os.exec for purpose of testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultExecutor

type DefaultExecutor struct{}

DefaultExecutor is a default implementation of Executable that passes back to standard library.

func (DefaultExecutor) Exec

func (DefaultExecutor) Exec(cmd string, args []string) ([]byte, error)

Exec proxies all requests to exec.Command() Used to support unit testing.

type Executable

type Executable interface {
	Exec(cmd string, args []string) ([]byte, error)
}

Executable is a facade to exec.Command().Output()

type FakeExecutor

type FakeExecutor struct {
	Output   []byte
	Error    error
	Commands *string
}

FakeExecutor implements Executable stores faked Output, Error and commands recorded by Exec.

func (*FakeExecutor) Exec

func (x *FakeExecutor) Exec(cmd string, args []string) ([]byte, error)

Exec is a method of fake executor that will record all incoming commands and use faked Output and Error.

Jump to

Keyboard shortcuts

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