isolatedHome rewires HOME and CAM_CONFIG_DIR to a fresh tempdir so commands that write to ~/ touch nothing outside the test.
(t *testing.T)
| 44 | // isolatedHome rewires HOME and CAM_CONFIG_DIR to a fresh tempdir so commands |
| 45 | // that write to ~/ touch nothing outside the test. |
| 46 | func isolatedHome(t *testing.T) string { |
| 47 | t.Helper() |
| 48 | dir := t.TempDir() |
| 49 | t.Setenv("HOME", dir) |
| 50 | t.Setenv("CAM_CONFIG_DIR", filepath.Join(dir, "cfg")) |
| 51 | return dir |
| 52 | } |
| 53 | |
| 54 | // seedProvider seeds a single provider into the SQLite store at storePath |
| 55 | // by running `cam provider add` via execute(). |
no outgoing calls
no test coverage detected