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