vipertest

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stub

func Stub[T any](t *testing.T, v *viper.Viper, val viperutil.Value[T]) func()

Stub stubs out a given value to use the passed-in viper to retrieve its config value for testing purposes. It returns a function to undo this, resetting the Value to whatever registry (Static, or Dynamic) it was originally bound to.

It fails the test if a caller attempts to stub the same value multiple times to a particular viper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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