diff options
author | Anthony HAMON <anthony.hamon@iadvize.com> | 2018-08-27 23:20:27 +0200 |
---|---|---|
committer | Anthony HAMON <hamon.anth@gmail.com> | 2018-08-29 12:03:32 +0200 |
commit | 13f90735522d55d83c724aa949dcef3061da290e (patch) | |
tree | 5a19ab64b647a3f120ed704baf1742494396a2b6 /pkg | |
parent | 49b507d2ff71d0ba1797695ed55be8217a3e1e6a (diff) |
add test for GetStashEntryDiff
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/git_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go index e709e747a..d8df7b4b0 100644 --- a/pkg/commands/git_test.go +++ b/pkg/commands/git_test.go @@ -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")) |