mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
add test for CurrentBranchName
This commit is contained in:
parent
fb9596a3ff
commit
eb69d98f99
2 changed files with 17 additions and 1 deletions
|
@ -1763,3 +1763,15 @@ func TestGitCommandGetMergeBase(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGitCommandCurrentBranchName(t *testing.T) {
|
||||
gitCmd := newDummyGitCommand()
|
||||
gitCmd.OSCommand.command = func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.Equal(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"symbolic-ref", "--short", "HEAD"}, args)
|
||||
return exec.Command("echo", "master")
|
||||
}
|
||||
output, err := gitCmd.CurrentBranchName()
|
||||
assert.Equal(t, "master", output)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue