Use real config in fork cmd tests

This commit is contained in:
William Martin 2023-12-01 15:18:51 +01:00
parent 5b3e7290be
commit dc0f6d55e2

View file

@ -211,7 +211,7 @@ func TestRepoFork(t *testing.T) {
httpStubs func(*httpmock.Registry)
execStubs func(*run.CommandStubber)
promptStubs func(*prompter.MockPrompter)
cfgStubs func(*config.ConfigMock)
cfgStubs func(config.Config)
remotes []*context.Remote
wantOut string
wantErrOut string
@ -254,7 +254,7 @@ func TestRepoFork(t *testing.T) {
Repo: ghrepo.New("OWNER", "REPO"),
},
},
cfgStubs: func(c *config.ConfigMock) {
cfgStubs: func(c config.Config) {
c.Set("", "git_protocol", "")
},
httpStubs: forkPost,
@ -731,7 +731,7 @@ func TestRepoFork(t *testing.T) {
return &http.Client{Transport: reg}, nil
}
cfg := config.NewBlankConfig()
cfg, _ := config.NewIsolatedTestConfig(t)
if tt.cfgStubs != nil {
tt.cfgStubs(cfg)
}