(t *testing.T)
| 21 | ) |
| 22 | |
| 23 | func TestNewCmdDevelop(t *testing.T) { |
| 24 | // Test shared parsing of issue number / URL. |
| 25 | argparsetest.TestArgParsing(t, NewCmdDevelop) |
| 26 | |
| 27 | tests := []struct { |
| 28 | name string |
| 29 | input string |
| 30 | output DevelopOptions |
| 31 | expectedBaseRepo ghrepo.Interface |
| 32 | wantStdout string |
| 33 | wantStderr string |
| 34 | wantErr bool |
| 35 | errMsg string |
| 36 | }{ |
| 37 | { |
| 38 | name: "branch-repo flag", |
| 39 | input: "1 --branch-repo owner/repo", |
| 40 | output: DevelopOptions{ |
| 41 | IssueNumber: 1, |
| 42 | BranchRepo: "owner/repo", |
| 43 | }, |
| 44 | }, |
| 45 | { |
| 46 | name: "base flag", |
| 47 | input: "1 --base feature", |
| 48 | output: DevelopOptions{ |
| 49 | IssueNumber: 1, |
| 50 | BaseBranch: "feature", |
| 51 | }, |
| 52 | }, |
| 53 | { |
| 54 | name: "checkout flag", |
| 55 | input: "1 --checkout", |
| 56 | output: DevelopOptions{ |
| 57 | IssueNumber: 1, |
| 58 | Checkout: true, |
| 59 | }, |
| 60 | }, |
| 61 | { |
| 62 | name: "list flag", |
| 63 | input: "1 --list", |
| 64 | output: DevelopOptions{ |
| 65 | IssueNumber: 1, |
| 66 | List: true, |
| 67 | }, |
| 68 | }, |
| 69 | { |
| 70 | name: "name flag", |
| 71 | input: "1 --name feature", |
| 72 | output: DevelopOptions{ |
| 73 | IssueNumber: 1, |
| 74 | Name: "feature", |
| 75 | }, |
| 76 | }, |
| 77 | { |
| 78 | name: "issue-repo flag", |
| 79 | input: "1 --issue-repo cli/cli", |
| 80 | output: DevelopOptions{ |
nothing calls this directly
no test coverage detected