testutil

package
v0.0.0-...-4e386bd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBundleStubs

func DefaultBundleStubs(t *testing.T, controller *gomock.Controller, config sheaf.BundleConfig, manifests []sheaf.BundleManifest) *mocks.MockBundle

DefaultBundleStubs are the default bundle stubs.

func GenerateBundle

func GenerateBundle(t *testing.T, controller *gomock.Controller, options ...BundleGeneratorOption) *mocks.MockBundle

GenerateBundle generates a bundle mock.

func GenerateBundleConfig

func GenerateBundleConfig(controller *gomock.Controller) *mocks.MockBundleConfig

GenerateBundleConfig generates a bundle config mock.

func NormalizeNewlines

func NormalizeNewlines(d []byte) []byte

NormalizeNewlines converts newline conventions for mac and windows with their unix equivalent

func SlurpData

func SlurpData(t *testing.T, source string) []byte

SlurpData reads bytes from a file.

func StageFile

func StageFile(t *testing.T, name, dest string) []byte

StageFile stages a file to a destination.

func Testdata

func Testdata(t *testing.T, parts ...string) []byte

Testdata returns test data as bytes.

func WithBundleDir

func WithBundleDir(t *testing.T, fn func(dir string))

WithBundleDir creates a bundle directory and runs a function.

Types

type BundleGenerator

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

BundleGenerator generates a sheaf.Bundle mock.

type BundleGeneratorOption

type BundleGeneratorOption func(generator BundleGenerator) BundleGenerator

BundleGeneratorOption is a functional option for configuring BundleGenerator.

func BundleGeneratorConfig

func BundleGeneratorConfig(config sheaf.BundleConfig) BundleGeneratorOption

BundleGeneratorConfig sets config for BundleGenerator.

func BundleGeneratorCreateBundle

func BundleGeneratorCreateBundle(fn CreateBundleFunc) BundleGeneratorOption

BundleGeneratorCreateBundle sets the bundle creator for BundleGenerator.

func BundleGeneratorManifests

func BundleGeneratorManifests(list []sheaf.BundleManifest) BundleGeneratorOption

BundleGeneratorManifests sets the bundle manifests for BundleGenerator.

type CreateBundleFunc

type CreateBundleFunc func(t *testing.T, controller *gomock.Controller, config sheaf.BundleConfig, manifests []sheaf.BundleManifest) *mocks.MockBundle

CreateBundleFunc is a function that create a Bundle mock.

Jump to

Keyboard shortcuts

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