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 ¶
func OptionsEquals ¶
func OptionsEquals(wantOpts any) AssertionFunc
Click to show internal directories.
Click to hide internal directories.