testutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFileBuilder

type ConfigFileBuilder struct {
	*testing.T
	kickoff.Config
}

ConfigFileBuilder is a utility to build kickoff config files in tests.

func NewConfigFileBuilder

func NewConfigFileBuilder(t *testing.T) *ConfigFileBuilder

NewConfigFileBuilder creates a new *ConfigFileBuilder.

func (*ConfigFileBuilder) Create

func (b *ConfigFileBuilder) Create() *os.File

Create creates the config file in the temp directory. The config files are named `kickoff-config-*.yaml` and need to be cleaned by calling `os.Remove` after tests are finished.

configFile := testutil.NewConfigFileBuilder(t).Create()
defer os.Remove(configFile.Name())

func (*ConfigFileBuilder) WithProjectOwner

func (b *ConfigFileBuilder) WithProjectOwner(owner string) *ConfigFileBuilder

WithProjectOwner sets the project.owner config field.

func (*ConfigFileBuilder) WithRepository

func (b *ConfigFileBuilder) WithRepository(name, url string) *ConfigFileBuilder

WithRepository adds a repository with name and url to the config.

func (*ConfigFileBuilder) WithValues

func (b *ConfigFileBuilder) WithValues(values template.Values) *ConfigFileBuilder

WithValues sets the values in the config.

Jump to

Keyboard shortcuts

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