1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-05 15:15:49 +02:00

add test for GetStashEntryDiff

This commit is contained in:
Anthony HAMON 2018-08-27 23:20:27 +02:00 committed by Anthony HAMON
parent 49b507d2ff
commit 13f9073552

View File

@ -70,6 +70,20 @@ func TestGitCommandGetStashEntries(t *testing.T) {
}
}
func TestGetStashEntryDiff(t *testing.T) {
gitCmd := newDummyGitCommand()
gitCmd.OSCommand.command = func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
assert.EqualValues(t, []string{"stash", "show", "-p", "--color", "stash@{1}"}, args)
return exec.Command("echo")
}
_, err := gitCmd.GetStashEntryDiff(1)
assert.NoError(t, err)
}
func TestGitCommandDiff(t *testing.T) {
gitCommand := newDummyGitCommand()
assert.NoError(t, test.GenerateRepo("lots_of_diffs.sh"))