From f1be1111cfe631ff22a348461254c8a6ed8e6321 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Thu, 14 May 2026 12:49:48 -0400 Subject: [PATCH] fix(tests): round-trip via frontmatter get to satisfy lint-no-source-grep --- tests/bug-3509-path-spaces.test.cjs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/bug-3509-path-spaces.test.cjs b/tests/bug-3509-path-spaces.test.cjs index d1a45238c..5e09ff89d 100644 --- a/tests/bug-3509-path-spaces.test.cjs +++ b/tests/bug-3509-path-spaces.test.cjs @@ -73,10 +73,14 @@ describe('bug-3509: frontmatter get/set/merge/validate survive spaces in file pa }); test('frontmatter set works when file path contains spaces', () => { - const result = runGsdTools(['frontmatter', 'set', tmpFile, '--field', 'phase', '--value', '02']); - assert.ok(result.success, `Command failed: ${result.error}`); - const content = fs.readFileSync(tmpFile, 'utf-8'); - assert.ok(content.includes('phase: 02'), 'field should be updated in file'); + const setResult = runGsdTools(['frontmatter', 'set', tmpFile, '--field', 'phase', '--value', '02']); + assert.ok(setResult.success, `set failed: ${setResult.error}`); + // Verify behaviorally — round-trip via frontmatter get rather than reading the file + // and grepping (which trips lint-no-source-grep even on tmp files). + const getResult = runGsdTools(['frontmatter', 'get', tmpFile]); + assert.ok(getResult.success, `get failed: ${getResult.error}`); + const parsed = JSON.parse(getResult.output); + assert.strictEqual(parsed.phase, '02', 'field should be updated to "02"'); }); test('frontmatter validate works when file path contains spaces', () => {