MCPcopy
hub / github.com/cheat/cheat / TestConfigFailure

Function TestConfigFailure

internal/config/config_test.go:338–345  ·  view source on GitHub ↗

TestConfigFailure asserts that an error is returned if the config file cannot be read.

(t *testing.T)

Source from the content-addressed store, hash-verified

336// TestConfigFailure asserts that an error is returned if the config file
337// cannot be read.
338func TestConfigFailure(t *testing.T) {
339
340 // attempt to read a non-existent config file
341 _, err := New("/does-not-exit", false)
342 if err == nil {
343 t.Errorf("failed to error on unreadable config")
344 }
345}
346
347// TestEditorEnvOverride asserts that $VISUAL and $EDITOR override the
348// config file value at runtime (regression test for #589)

Callers

nothing calls this directly

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected