MCPcopy Create free account
hub / github.com/compozy/agh / TestWorkspaceEditRejectsConflictingDirUpdates

Function TestWorkspaceEditRejectsConflictingDirUpdates

internal/cli/workspace_test.go:166–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestWorkspaceEditRejectsConflictingDirUpdates(t *testing.T) {
167 t.Parallel()
168
169 t.Run("Should reject conflicting dir updates", func(t *testing.T) {
170 t.Parallel()
171
172 deps := newTestDeps(t, &stubClient{
173 getWorkspaceFn: func(_ context.Context, _ string) (WorkspaceDetailRecord, error) {
174 return WorkspaceDetailRecord{
175 Workspace: WorkspaceRecord{ID: "ws_alpha", AddDirs: []string{"/workspace/shared-a"}},
176 }, nil
177 },
178 })
179
180 code, _, stderr := executeRootCommandWithExit(t, deps,
181 "workspace", "edit", "alpha",
182 "--add-dir", "/workspace/shared-a",
183 "--remove-dir", "/workspace/shared-a",
184 )
185 if code != 1 {
186 t.Fatalf("executeRootCommandWithExit() code = %d, want 1", code)
187 }
188 if !strings.Contains(stderr, "cannot add and remove the same directory") {
189 t.Fatalf("stderr = %q, want conflicting directory validation message", stderr)
190 }
191 })
192}
193
194func TestWorkspaceListInfoAndRemove(t *testing.T) {
195 t.Parallel()

Callers

nothing calls this directly

Calls 4

newTestDepsFunction · 0.85
ContainsMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected