Skip to content

Commit c6c3e72

Browse files
committed
Unexport StubConfig
1 parent 927e4c7 commit c6c3e72

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/config/config_file_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
func Test_parseConfig(t *testing.T) {
14-
defer StubConfig(`---
14+
defer stubConfig(`---
1515
hosts:
1616
github.com:
1717
user: monalisa
@@ -28,7 +28,7 @@ hosts:
2828
}
2929

3030
func Test_parseConfig_multipleHosts(t *testing.T) {
31-
defer StubConfig(`---
31+
defer stubConfig(`---
3232
hosts:
3333
example.com:
3434
user: wronguser
@@ -48,7 +48,7 @@ hosts:
4848
}
4949

5050
func Test_parseConfig_hostsFile(t *testing.T) {
51-
defer StubConfig("", `---
51+
defer stubConfig("", `---
5252
github.com:
5353
user: monalisa
5454
oauth_token: OTOKEN
@@ -64,7 +64,7 @@ github.com:
6464
}
6565

6666
func Test_parseConfig_hostFallback(t *testing.T) {
67-
defer StubConfig(`---
67+
defer stubConfig(`---
6868
git_protocol: ssh
6969
`, `---
7070
github.com:
@@ -89,7 +89,7 @@ example.com:
8989
}
9090

9191
func Test_parseConfig_migrateConfig(t *testing.T) {
92-
defer StubConfig(`---
92+
defer stubConfig(`---
9393
github.com:
9494
- user: keiyuri
9595
oauth_token: 123456
@@ -134,7 +134,7 @@ func Test_parseConfigFile(t *testing.T) {
134134

135135
for _, tt := range tests {
136136
t.Run(fmt.Sprintf("contents: %q", tt.contents), func(t *testing.T) {
137-
defer StubConfig(tt.contents, "")()
137+
defer stubConfig(tt.contents, "")()
138138
_, yamlRoot, err := parseConfigFile("config.yml")
139139
if tt.wantsErr != (err != nil) {
140140
t.Fatalf("got error: %v", err)

internal/config/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func StubWriteConfig(wc io.Writer, wh io.Writer) func() {
3737
}
3838
}
3939

40-
func StubConfig(main, hosts string) func() {
40+
func stubConfig(main, hosts string) func() {
4141
orig := ReadConfigFile
4242
ReadConfigFile = func(fn string) ([]byte, error) {
4343
switch path.Base(fn) {

0 commit comments

Comments
 (0)