Skip to content

Commit fb42bb1

Browse files
committed
test(adopt): write CLI lockfile fixture beside skills dir
TestRunAdopt_WarnsOnLingeringLockfile still wrote .skill-lock.json inside the skills dir, but production ReadLock now reads it from the parent (~/.agents/.skill-lock.json). Use adopt.LockPath so the fixture matches, restoring the lingering-entry warning assertion.
1 parent d91dc65 commit fb42bb1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cmd/skillshare/adopt_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ func TestRunAdopt_WarnsOnLingeringLockfile(t *testing.T) {
130130
},
131131
}
132132
data, _ := json.Marshal(lock)
133-
if err := os.WriteFile(filepath.Join(actx.agentsPath, ".skill-lock.json"), data, 0o644); err != nil {
133+
// The lockfile lives beside the skills dir (~/.agents/.skill-lock.json),
134+
// one level up — matching where production ReadLock looks.
135+
lockPath := adopt.LockPath(actx.agentsPath)
136+
if err := os.WriteFile(lockPath, data, 0o644); err != nil {
134137
t.Fatalf("write lock: %v", err)
135138
}
136139

@@ -147,7 +150,7 @@ func TestRunAdopt_WarnsOnLingeringLockfile(t *testing.T) {
147150
}
148151

149152
// Lockfile must NOT be modified.
150-
raw, _ := os.ReadFile(filepath.Join(actx.agentsPath, ".skill-lock.json"))
153+
raw, _ := os.ReadFile(lockPath)
151154
var got map[string]any
152155
if err := json.Unmarshal(raw, &got); err != nil {
153156
t.Fatalf("lockfile became unreadable: %v", err)

0 commit comments

Comments
 (0)