summaryrefslogtreecommitdiffstats
path: root/pkg/commands/files_test.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-08 13:22:29 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-09 14:09:53 +1100
commit3621854dc79baf2064b00b561ebea0ecc8fcb5df (patch)
tree1553af714ab62e429a835eb682fedf3461b0993f /pkg/commands/files_test.go
parentc6b57d9b5700cc706902ff5d6e160ba832bf2a77 (diff)
fix tests
Diffstat (limited to 'pkg/commands/files_test.go')
-rw-r--r--pkg/commands/files_test.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/pkg/commands/files_test.go b/pkg/commands/files_test.go
index 6f03125cb..ed8a41783 100644
--- a/pkg/commands/files_test.go
+++ b/pkg/commands/files_test.go
@@ -6,6 +6,7 @@ import (
"github.com/go-errors/errors"
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
+ "github.com/jesseduffield/lazygit/pkg/config"
"github.com/stretchr/testify/assert"
)
@@ -145,12 +146,18 @@ func TestEditFileCmdStr(t *testing.T) {
}
for _, s := range scenarios {
- gitCmd := NewDummyGitCommandWithRunner(s.runner)
- gitCmd.UserConfig.OS.EditCommand = s.configEditCommand
- gitCmd.UserConfig.OS.EditCommandTemplate = s.configEditCommandTemplate
- gitCmd.OSCommand.GetenvFn = s.getenv
- gitCmd.gitConfig = git_config.NewFakeGitConfig(s.gitConfigMockResponses)
- s.test(gitCmd.File.GetEditCmdStr(s.filename, 1))
+ userConfig := config.GetDefaultConfig()
+ userConfig.OS.EditCommand = s.configEditCommand
+ userConfig.OS.EditCommandTemplate = s.configEditCommandTemplate
+
+ instance := buildFileCommands(commonDeps{
+ runner: s.runner,
+ userConfig: userConfig,
+ gitConfig: git_config.NewFakeGitConfig(s.gitConfigMockResponses),
+ getenv: s.getenv,
+ })
+
+ s.test(instance.GetEditCmdStr(s.filename, 1))
s.runner.CheckForMissingCalls()
}
}