(t *testing.T)
| 483 | } |
| 484 | |
| 485 | func TestWorkspaceEditRequiresChanges(t *testing.T) { |
| 486 | t.Parallel() |
| 487 | |
| 488 | t.Run("Should require changes", func(t *testing.T) { |
| 489 | t.Parallel() |
| 490 | |
| 491 | code, _, stderr := executeRootCommandWithExit(t, newTestDeps(t, &stubClient{}), "workspace", "edit", "alpha") |
| 492 | if code != 1 { |
| 493 | t.Fatalf("executeRootCommandWithExit() code = %d, want 1", code) |
| 494 | } |
| 495 | if !strings.Contains(stderr, "at least one edit flag is required") { |
| 496 | t.Fatalf("stderr = %q, want edit validation message", stderr) |
| 497 | } |
| 498 | }) |
| 499 | } |
| 500 | |
| 501 | func derefString(value *string) string { |
| 502 | if value == nil { |
nothing calls this directly
no test coverage detected