@@ -83,13 +83,21 @@ describe("Claude Code shell-hook reconciliation", () => {
8383 expect ( readFileSync ( zshrcPath , "utf8" ) . match ( / o p e n c o d e x c l a u d e - e n v h o o k / g) ) . toHaveLength ( 1 ) ;
8484 } ) ;
8585
86- test ( "does not treat a non-executable claude file as an installed CLI" , ( ) => {
87- writeFileSync ( join ( binDir , "claude" ) , "#!/bin/sh\nexit 0\n" , { mode : 0o644 } ) ;
86+ // Windows has no execute permission bit: `accessSync(path, X_OK)` succeeds for any
87+ // readable file, so a 0o644 fixture cannot express "present but not executable" there.
88+ // The case asserts a POSIX permission semantic, and skipping it on a platform that
89+ // cannot represent the precondition is honest; asserting it anyway measured the
90+ // fixture, not the product (#2152).
91+ test . skipIf ( originalPlatform === "win32" ) (
92+ "does not treat a non-executable claude file as an installed CLI" ,
93+ ( ) => {
94+ writeFileSync ( join ( binDir , "claude" ) , "#!/bin/sh\nexit 0\n" , { mode : 0o644 } ) ;
8895
89- expect ( claudeCodeCliInstalled ( ) ) . toBe ( false ) ;
90- expect ( reconcileShellHook ( true ) ) . toMatchObject ( { changed : false , state : "absent" } ) ;
91- expect ( existsSync ( zshrcPath ) ) . toBe ( false ) ;
92- } ) ;
96+ expect ( claudeCodeCliInstalled ( ) ) . toBe ( false ) ;
97+ expect ( reconcileShellHook ( true ) ) . toMatchObject ( { changed : false , state : "absent" } ) ;
98+ expect ( existsSync ( zshrcPath ) ) . toBe ( false ) ;
99+ } ,
100+ ) ;
93101
94102 test ( "removes the hook when system environment integration is inactive" , ( ) => {
95103 installClaudeCli ( ) ;
0 commit comments