fix(tests): use array form for space-containing paths in CLI invocations

On machines where os.tmpdir() returns a path with a space (e.g.
/Volumes/Mini Me/tmp), runGsdTools() string args were whitespace-split by
the helper tokeniser, truncating paths at the first space.  Switch all
calls that embed a dynamic path into the argument list to the array form
of runGsdTools() so execFileSync receives each path as a single argv slot.

Fixes #3509

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-14 12:43:48 -04:00
parent 625ccf5217
commit c21bbf116e
6 changed files with 162 additions and 20 deletions

View File

@@ -48,7 +48,7 @@ describe('dispatcher error paths', () => {
path.join(tmpDir, '.planning', 'STATE.md'),
'# Project State\n\n## Current Position\n\nPhase: 1 of 1 (Test)\n'
);
const result = runGsdTools(`--cwd=${tmpDir} state load`, process.cwd());
const result = runGsdTools(['--cwd=' + tmpDir, 'state', 'load'], process.cwd());
assert.strictEqual(result.success, true, `Should succeed with --cwd=, got: ${result.error}`);
});