diff --git a/internal/config/config_file_test.go b/internal/config/config_file_test.go index 9bbf82ca8..f12629d7a 100644 --- a/internal/config/config_file_test.go +++ b/internal/config/config_file_test.go @@ -11,7 +11,7 @@ import ( ) func Test_parseConfig(t *testing.T) { - defer StubConfig(`--- + defer stubConfig(`--- hosts: github.com: user: monalisa @@ -28,7 +28,7 @@ hosts: } func Test_parseConfig_multipleHosts(t *testing.T) { - defer StubConfig(`--- + defer stubConfig(`--- hosts: example.com: user: wronguser @@ -48,7 +48,7 @@ hosts: } func Test_parseConfig_hostsFile(t *testing.T) { - defer StubConfig("", `--- + defer stubConfig("", `--- github.com: user: monalisa oauth_token: OTOKEN @@ -64,7 +64,7 @@ github.com: } func Test_parseConfig_hostFallback(t *testing.T) { - defer StubConfig(`--- + defer stubConfig(`--- git_protocol: ssh `, `--- github.com: @@ -89,7 +89,7 @@ example.com: } func Test_parseConfig_migrateConfig(t *testing.T) { - defer StubConfig(`--- + defer stubConfig(`--- github.com: - user: keiyuri oauth_token: 123456 @@ -134,7 +134,7 @@ func Test_parseConfigFile(t *testing.T) { for _, tt := range tests { t.Run(fmt.Sprintf("contents: %q", tt.contents), func(t *testing.T) { - defer StubConfig(tt.contents, "")() + defer stubConfig(tt.contents, "")() _, yamlRoot, err := parseConfigFile("config.yml") if tt.wantsErr != (err != nil) { t.Fatalf("got error: %v", err) diff --git a/internal/config/testing.go b/internal/config/testing.go index a49178705..dcc26a176 100644 --- a/internal/config/testing.go +++ b/internal/config/testing.go @@ -37,7 +37,7 @@ func StubWriteConfig(wc io.Writer, wh io.Writer) func() { } } -func StubConfig(main, hosts string) func() { +func stubConfig(main, hosts string) func() { orig := ReadConfigFile ReadConfigFile = func(fn string) ([]byte, error) { switch path.Base(fn) {