context

package
v0.1.0-raplpha....-c86f6ab Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBuilder

type CommandBuilder func(name string, arg ...string) *exec.Cmd

func NewTestCommand

func NewTestCommand() CommandBuilder

type Context

type Context struct {
	Debug      bool
	FileSystem *afero.Afero
	In         io.Reader
	Out        io.Writer
	Err        io.Writer
	NewCommand CommandBuilder
}

func New

func New() *Context

func (*Context) CopyDirectory

func (c *Context) CopyDirectory(srcDir, destDir string, includeBaseDir bool) error

func (*Context) CopyFile

func (c *Context) CopyFile(src, dest string) error

func (*Context) WriteOutput

func (c *Context) WriteOutput(lines []string) error

WriteOutput writes the given lines to a file in the output directory

type TestContext

type TestContext struct {
	*Context

	T *testing.T
	// contains filtered or unexported fields
}

func NewTestContext

func NewTestContext(t *testing.T) *TestContext

NewTestContext initializes a configuration suitable for testing, with the output buffered, and an in-memory file system.

func (*TestContext) AddTestDirectory

func (c *TestContext) AddTestDirectory(srcDir, destDir string)

func (*TestContext) AddTestFile

func (c *TestContext) AddTestFile(src, dest string) []byte

TODO: Replace these functions with a union file system for test data

func (*TestContext) GetOutput

func (c *TestContext) GetOutput() string

Jump to

Keyboard shortcuts

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