Skip to content

Commit

Permalink
Add tests for known cli version
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Sep 10, 2023
1 parent a4a2ef1 commit 90239fb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions known_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ func TestKnownCmd(t *testing.T) {
assert.False(t, ctx.Success, "No success")
}

{
ctx := types.Context{Debug: true}
cmd := KnownCmd{}
cmd.CLI.Attr = attr.Version
cmd.CLI.Name = "git"
err := cmd.Run(&ctx)
assert.NoError(t, err)
assert.True(t, ctx.Success, "success")
}

{
ctx := types.Context{Debug: true}
cmd := KnownCmd{}
cmd.CLI.Attr = attr.Version
cmd.CLI.Name = "gitzzz"
err := cmd.Run(&ctx)
assert.NoError(t, err)
assert.False(t, ctx.Success, "No success")
}

{
ctx := types.Context{Debug: true}
cmd := KnownCmd{}
Expand Down

0 comments on commit 90239fb

Please sign in to comment.