summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAnthony HAMON <anthony.hamon@iadvize.com>2018-08-27 23:20:27 +0200
committerAnthony HAMON <hamon.anth@gmail.com>2018-08-29 12:03:32 +0200
commit13f90735522d55d83c724aa949dcef3061da290e (patch)
tree5a19ab64b647a3f120ed704baf1742494396a2b6 /pkg
parent49b507d2ff71d0ba1797695ed55be8217a3e1e6a (diff)
add test for GetStashEntryDiff
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git_test.go14
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"))