testing

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context implements dependency.Context for convenient testing of dependency.StartFuncs.

func StubContext

func StubContext(abort <-chan struct{}, raw map[string]interface{}) *Context

StubContext returns a Context backed by abort and resources derived from raw.

func (*Context) Abort

func (ctx *Context) Abort() <-chan struct{}

Abort is part of the dependency.Context interface.

func (*Context) Get

func (ctx *Context) Get(name string, outPtr interface{}) error

Get is part of the dependency.Context interface.

type StubResource

type StubResource struct {
	Output interface{}
	Error  error
}

StubResource is used to define the behaviour of a StubGetResource func for a particular resource name.

type StubResources

type StubResources map[string]StubResource

StubResources defines the complete behaviour of a StubGetResource func.

func NewStubResources

func NewStubResources(raw map[string]interface{}) StubResources

NewStubResources converts raw into a StubResources by assuming that any non-error value is intended to be an output.

func (StubResources) Context

func (resources StubResources) Context() dependency.Context

Context returns a dependency.Context that never aborts, backed by resources.

Jump to

Keyboard shortcuts

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