MCPcopy Index your code
hub / github.com/cheat/cheat / assertCheatpathActive

Function assertCheatpathActive

test/integration/first_run_integration_test.go:279–289  ·  view source on GitHub ↗

assertCheatpathActive verifies that a named cheatpath is present and uncommented in the config.

(t *testing.T, content string, name string)

Source from the content-addressed store, hash-verified

277// assertCheatpathActive verifies that a named cheatpath is present and
278// uncommented in the config.
279func assertCheatpathActive(t *testing.T, content string, name string) {
280 t.Helper()
281 marker := "- name: " + name
282 for _, line := range strings.Split(content, "\n") {
283 trimmed := strings.TrimSpace(line)
284 if trimmed == marker {
285 return
286 }
287 }
288 t.Errorf("expected active (uncommented) cheatpath %q", name)
289}
290
291// firstRunConfigExists checks whether a cheat config file exists under the
292// given home directory at any of the standard locations.

Callers 1

TestFirstRunIntegrationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected