fake

package
v0.0.0-...-dd1685f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Msg = "fake error"

Msg is the fake message

Variables

This section is empty.

Functions

func NewExec

func NewExec(file string) virtual.Exec

NewExec creates a new exec package backed by fakes.

func NewExecCmd

func NewExecCmd(file string) virtual.Cmd

NewExecCmd creates a new fake exec cmd

func NewFailExec

func NewFailExec() virtual.Exec

NewFailExec creates an Exec packed use for for testing failures.

func NewFailExecCmd

func NewFailExecCmd() virtual.Cmd

NewFailExecCmd is used for testing a cmd that should fail.

func NewLogger

func NewLogger() logger.Logger

NewLogger creates a new fake logger

Types

type ErrFakeFatal

type ErrFakeFatal struct {
}

ErrFakeFatal is the fake fatal error.

func (ErrFakeFatal) Error

func (f ErrFakeFatal) Error() string

type Exec

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

Exec is the fake exec package

func (Exec) Command

func (e Exec) Command(name string, arg ...string) virtual.Cmd

type FailExec

type FailExec struct {
}

FailExec is used for testing exec package with expected failures.

func (FailExec) Command

func (e FailExec) Command(name string, arg ...string) virtual.Cmd

type OS

type OS struct {
	Code int
}

OS is the fake os package.

func NewOS

func NewOS() *OS

NewOS creates a new os package backed by fakes.

func (*OS) Exit

func (o *OS) Exit(code int)

Jump to

Keyboard shortcuts

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