integration

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrExitCodeNotAvailable is used for exit code retrieval failure
	ErrExitCodeNotAvailable = errors.New("Exit code not available")
)

Functions

func GetBrokenHome

func GetBrokenHome() string

GetBrokenHome gets mocked broken user's home path

func GetExitCode

func GetExitCode(err error) int

GetExitCode tries to retrieve the exit code from an exit error

func GetLoginHome

func GetLoginHome() string

GetLoginHome gets mocked logged in user's home path

func GetLogoutHome

func GetLogoutHome() string

GetLogoutHome gets mocked logged out user's home path

func GetRegularHome

func GetRegularHome() string

GetRegularHome gets mocked regular user's home path

func Setup

func Setup()

Setup an integration test environment

func Teardown

func Teardown()

Teardown an integration test environment

Types

type Command

type Command struct {
	Args     []string
	Env      []string
	Dir      string
	Stdin    io.Reader
	Stderr   *bytes.Buffer
	Stdout   *bytes.Buffer
	ExitCode int
}

Command structure

func (*Command) Prepare

func (cmd *Command) Prepare() *exec.Cmd

Prepare prepares the executable command

func (*Command) Run

func (cmd *Command) Run()

Run runs the command

type Expect

type Expect struct {
	Stderr   string
	Stdout   string
	ExitCode int
}

Expect structure

func (*Expect) Assert

func (e *Expect) Assert(t *testing.T, cmd *Command)

Assert tests if command executed exactly as described by Expect

Jump to

Keyboard shortcuts

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