Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ATGardner committed Jun 28, 2021
1 parent 38dafcd commit 4e59ae4
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions pkg/git/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,34 +720,34 @@ func TestAddFlags(t *testing.T) {
wantedFlags []flag
}{
"Should create flags without a prefix": {
opts: &AddFlagsOptions{
Optional: true,
},
opts: &AddFlagsOptions{},
wantedFlags: []flag{
{
name: "git-token",
shorthand: "t",
usage: "Your git provider api token [GIT_TOKEN]",
required: true,
},
{
name: "repo",
usage: "Repository URL [GIT_REPO]",
name: "repo",
usage: "Repository URL [GIT_REPO]",
required: true,
},
},
},
"Should create flags with required": {
opts: &AddFlagsOptions{},
"Should create flags with optional": {
opts: &AddFlagsOptions{
Optional: true,
},
wantedFlags: []flag{
{
name: "git-token",
shorthand: "t",
usage: "Your git provider api token [GIT_TOKEN]",
required: true,
},
{
name: "repo",
usage: "Repository URL [GIT_REPO]",
required: true,
name: "repo",
usage: "Repository URL [GIT_REPO]",
},
},
},
Expand All @@ -757,12 +757,14 @@ func TestAddFlags(t *testing.T) {
},
wantedFlags: []flag{
{
name: "prefix-git-token",
usage: "Your git provider api token [PREFIX_GIT_TOKEN]",
name: "prefix-git-token",
usage: "Your git provider api token [PREFIX_GIT_TOKEN]",
required: true,
},
{
name: "prefix-repo",
usage: "Repository URL [PREFIX_GIT_REPO]",
name: "prefix-repo",
usage: "Repository URL [PREFIX_GIT_REPO]",
required: true,
},
},
},
Expand All @@ -772,12 +774,14 @@ func TestAddFlags(t *testing.T) {
},
wantedFlags: []flag{
{
name: "prefix-git-token",
usage: "Your git provider api token [PREFIX_GIT_TOKEN]",
name: "prefix-git-token",
usage: "Your git provider api token [PREFIX_GIT_TOKEN]",
required: true,
},
{
name: "prefix-repo",
usage: "Repository URL [PREFIX_GIT_REPO]",
name: "prefix-repo",
usage: "Repository URL [PREFIX_GIT_REPO]",
required: true,
},
},
},
Expand Down

0 comments on commit 4e59ae4

Please sign in to comment.