(t *testing.T)
| 30 | ) |
| 31 | |
| 32 | func TestNewCmdView(t *testing.T) { |
| 33 | tests := []struct { |
| 34 | name string |
| 35 | cli string |
| 36 | tty bool |
| 37 | wants ViewOptions |
| 38 | wantsErr bool |
| 39 | }{ |
| 40 | { |
| 41 | name: "blank nontty", |
| 42 | wantsErr: true, |
| 43 | }, |
| 44 | { |
| 45 | name: "blank tty", |
| 46 | tty: true, |
| 47 | wants: ViewOptions{ |
| 48 | Prompt: true, |
| 49 | }, |
| 50 | }, |
| 51 | { |
| 52 | name: "web tty", |
| 53 | tty: true, |
| 54 | cli: "--web", |
| 55 | wants: ViewOptions{ |
| 56 | Prompt: true, |
| 57 | Web: true, |
| 58 | }, |
| 59 | }, |
| 60 | { |
| 61 | name: "web nontty", |
| 62 | cli: "1234 --web", |
| 63 | wants: ViewOptions{ |
| 64 | Web: true, |
| 65 | RunID: "1234", |
| 66 | }, |
| 67 | }, |
| 68 | { |
| 69 | name: "disallow web and log", |
| 70 | tty: true, |
| 71 | cli: "-w --log", |
| 72 | wantsErr: true, |
| 73 | }, |
| 74 | { |
| 75 | name: "disallow log and log-failed", |
| 76 | tty: true, |
| 77 | cli: "--log --log-failed", |
| 78 | wantsErr: true, |
| 79 | }, |
| 80 | { |
| 81 | name: "exit status", |
| 82 | cli: "--exit-status 1234", |
| 83 | wants: ViewOptions{ |
| 84 | RunID: "1234", |
| 85 | ExitStatus: true, |
| 86 | }, |
| 87 | }, |
| 88 | { |
| 89 | name: "verbosity", |
nothing calls this directly
no test coverage detected