1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-23 00:39:13 +02:00

add test for StashSave and refactor StashSave method

This commit is contained in:
Anthony HAMON
2018-08-28 20:24:19 +02:00
committed by Anthony HAMON
parent 99840d8fc4
commit 45fa257128
2 changed files with 13 additions and 1 deletions

View File

@ -173,6 +173,18 @@ func TestGitCommandStashDo(t *testing.T) {
assert.NoError(t, gitCmd.StashDo(1, "drop"))
}
func TestGitCommandStashSave(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", "save", "A stash message"}, args)
return exec.Command("echo")
}
assert.NoError(t, gitCmd.StashSave("A stash message"))
}
func TestGitCommandDiff(t *testing.T) {
gitCommand := newDummyGitCommand()
assert.NoError(t, test.GenerateRepo("lots_of_diffs.sh"))