(t *testing.T)
| 164 | } |
| 165 | |
| 166 | func 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 | |
| 194 | func TestWorkspaceListInfoAndRemove(t *testing.T) { |
| 195 | t.Parallel() |
nothing calls this directly
no test coverage detected