(t *testing.T)
| 21 | ) |
| 22 | |
| 23 | func TestNewCmdList(t *testing.T) { |
| 24 | tests := []struct { |
| 25 | name string |
| 26 | cli string |
| 27 | tty bool |
| 28 | wants ListOptions |
| 29 | wantsErr bool |
| 30 | }{ |
| 31 | { |
| 32 | name: "blank", |
| 33 | wants: ListOptions{ |
| 34 | Limit: defaultLimit, |
| 35 | }, |
| 36 | }, |
| 37 | { |
| 38 | name: "limit", |
| 39 | cli: "--limit 100", |
| 40 | wants: ListOptions{ |
| 41 | Limit: 100, |
| 42 | }, |
| 43 | }, |
| 44 | { |
| 45 | name: "bad limit", |
| 46 | cli: "--limit hi", |
| 47 | wantsErr: true, |
| 48 | }, |
| 49 | { |
| 50 | name: "workflow", |
| 51 | cli: "--workflow foo.yml", |
| 52 | wants: ListOptions{ |
| 53 | Limit: defaultLimit, |
| 54 | WorkflowSelector: "foo.yml", |
| 55 | }, |
| 56 | }, |
| 57 | { |
| 58 | name: "branch", |
| 59 | cli: "--branch new-cool-stuff", |
| 60 | wants: ListOptions{ |
| 61 | Limit: defaultLimit, |
| 62 | Branch: "new-cool-stuff", |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | name: "user", |
| 67 | cli: "--user bak1an", |
| 68 | wants: ListOptions{ |
| 69 | Limit: defaultLimit, |
| 70 | Actor: "bak1an", |
| 71 | }, |
| 72 | }, |
| 73 | { |
| 74 | name: "status", |
| 75 | cli: "--status completed", |
| 76 | wants: ListOptions{ |
| 77 | Limit: defaultLimit, |
| 78 | Status: "completed", |
| 79 | }, |
| 80 | }, |
nothing calls this directly
no test coverage detected