assertCheatpathActive verifies that a named cheatpath is present and uncommented in the config.
(t *testing.T, content string, name string)
| 277 | // assertCheatpathActive verifies that a named cheatpath is present and |
| 278 | // uncommented in the config. |
| 279 | func 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. |
no outgoing calls
no test coverage detected