gobtestutils

package
v0.0.0-...-9395453 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApplication

func NewApplication(t *testing.T, cfg *gob.SetupConfig, assertions ...AssertionFunc) gob.Application

NewApplication takes a testing.T, a gob setup config, and a slice of assertions, and returns a gob application that will, instead of setting up commands with their normal RunE, set up commands such that the assertions are called with the testing.T after config state is set up by reading flags, env vars, and config files. Useful for testing that expected configuration options are wired up. Note that initializers will be cleared from the gob setup config, since the initialization may happen more than once and affect global state. For necessary global state, a workaround is to set it in a TestingMain.

Types

type AssertionFunc

type AssertionFunc func(t *testing.T, cmd *cobra.Command, args []string, cfgs ...any)

func OptionsEquals

func OptionsEquals(wantOpts any) AssertionFunc

Jump to

Keyboard shortcuts

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