(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestNewCmdView(t *testing.T) { |
| 22 | tests := []struct { |
| 23 | name string |
| 24 | cli string |
| 25 | tty bool |
| 26 | wants ViewOptions |
| 27 | wantsErr bool |
| 28 | }{ |
| 29 | { |
| 30 | name: "blank tty", |
| 31 | tty: true, |
| 32 | wants: ViewOptions{ |
| 33 | Prompt: true, |
| 34 | }, |
| 35 | }, |
| 36 | { |
| 37 | name: "blank nontty", |
| 38 | wantsErr: true, |
| 39 | }, |
| 40 | { |
| 41 | name: "arg tty", |
| 42 | cli: "123", |
| 43 | tty: true, |
| 44 | wants: ViewOptions{ |
| 45 | Selector: "123", |
| 46 | }, |
| 47 | }, |
| 48 | { |
| 49 | name: "arg nontty", |
| 50 | cli: "123", |
| 51 | wants: ViewOptions{ |
| 52 | Selector: "123", |
| 53 | Raw: true, |
| 54 | }, |
| 55 | }, |
| 56 | { |
| 57 | name: "web tty", |
| 58 | cli: "--web", |
| 59 | tty: true, |
| 60 | wants: ViewOptions{ |
| 61 | Prompt: true, |
| 62 | Web: true, |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | name: "web nontty", |
| 67 | cli: "-w 123", |
| 68 | wants: ViewOptions{ |
| 69 | Raw: true, |
| 70 | Web: true, |
| 71 | Selector: "123", |
| 72 | }, |
| 73 | }, |
| 74 | { |
| 75 | name: "yaml tty", |
| 76 | cli: "--yaml", |
| 77 | tty: true, |
| 78 | wants: ViewOptions{ |
nothing calls this directly
no test coverage detected