summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-08 15:46:29 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-09 14:09:53 +1100
commit5d6d8942862428afb72bc45b562af10ceac6e0a3 (patch)
tree8fbddeb3e1d9cbd216de82f098ad10cf955ca88f /pkg
parente4e521f58a35ff177c8a3ef3a5be5057420cc2ba (diff)
fix test
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git_config/cached_git_config_test.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkg/commands/git_config/cached_git_config_test.go b/pkg/commands/git_config/cached_git_config_test.go
index f03535a6e..1e58b2bf6 100644
--- a/pkg/commands/git_config/cached_git_config_test.go
+++ b/pkg/commands/git_config/cached_git_config_test.go
@@ -1,6 +1,8 @@
package git_config
import (
+ "os/exec"
+ "strings"
"testing"
"github.com/jesseduffield/lazygit/pkg/utils"
@@ -52,8 +54,9 @@ func TestGetBool(t *testing.T) {
t.Run(s.testName, func(t *testing.T) {
fake := NewFakeGitConfig(s.mockResponses)
real := NewCachedGitConfig(
- func(key string) (string, error) {
- return fake.Get(key), nil
+ func(cmd *exec.Cmd) (string, error) {
+ assert.Equal(t, "git config --get --null commit.gpgsign", strings.Join(cmd.Args, " "))
+ return fake.Get("commit.gpgsign"), nil
},
utils.NewDummyLog(),
)
@@ -88,8 +91,9 @@ func TestGet(t *testing.T) {
t.Run(s.testName, func(t *testing.T) {
fake := NewFakeGitConfig(s.mockResponses)
real := NewCachedGitConfig(
- func(key string) (string, error) {
- return fake.Get(key), nil
+ func(cmd *exec.Cmd) (string, error) {
+ assert.Equal(t, "git config --get --null commit.gpgsign", strings.Join(cmd.Args, " "))
+ return fake.Get("commit.gpgsign"), nil
},
utils.NewDummyLog(),
)
@@ -101,9 +105,9 @@ func TestGet(t *testing.T) {
// verifying that the cache is used
count := 0
real := NewCachedGitConfig(
- func(key string) (string, error) {
+ func(cmd *exec.Cmd) (string, error) {
count++
- assert.Equal(t, "commit.gpgsign", key)
+ assert.Equal(t, "git config --get --null commit.gpgsign", strings.Join(cmd.Args, " "))
return "blah", nil
},
utils.NewDummyLog(),