(t *testing.T)
| 22 | ) |
| 23 | |
| 24 | func TestNewCmdDelete(t *testing.T) { |
| 25 | tests := []struct { |
| 26 | name string |
| 27 | cli string |
| 28 | tty bool |
| 29 | want DeleteOptions |
| 30 | wantErr bool |
| 31 | wantErrMsg string |
| 32 | }{ |
| 33 | { |
| 34 | name: "valid selector", |
| 35 | cli: "123", |
| 36 | tty: true, |
| 37 | want: DeleteOptions{ |
| 38 | Selector: "123", |
| 39 | }, |
| 40 | }, |
| 41 | { |
| 42 | name: "valid selector, no ID supplied", |
| 43 | cli: "", |
| 44 | tty: true, |
| 45 | want: DeleteOptions{ |
| 46 | Selector: "", |
| 47 | }, |
| 48 | }, |
| 49 | { |
| 50 | name: "no ID supplied with --yes", |
| 51 | cli: "--yes", |
| 52 | tty: true, |
| 53 | want: DeleteOptions{ |
| 54 | Selector: "", |
| 55 | }, |
| 56 | }, |
| 57 | { |
| 58 | name: "selector with --yes, no tty", |
| 59 | cli: "123 --yes", |
| 60 | tty: false, |
| 61 | want: DeleteOptions{ |
| 62 | Selector: "123", |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | name: "ID arg without --yes, no tty", |
| 67 | cli: "123", |
| 68 | tty: false, |
| 69 | want: DeleteOptions{ |
| 70 | Selector: "", |
| 71 | }, |
| 72 | wantErr: true, |
| 73 | wantErrMsg: "--yes required when not running interactively", |
| 74 | }, |
| 75 | { |
| 76 | name: "no ID supplied with --yes, no tty", |
| 77 | cli: "--yes", |
| 78 | tty: false, |
| 79 | want: DeleteOptions{ |
| 80 | Selector: "", |
| 81 | }, |
nothing calls this directly
no test coverage detected