X Tutup
Skip to content

Commit c57e30f

Browse files
committed
Fix stubbing config in tests on Windows
1 parent c6c3e72 commit c57e30f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/config/testing.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"io"
66
"os"
7-
"path"
7+
"path/filepath"
88
)
99

1010
func StubBackupConfig() func() {
@@ -21,7 +21,7 @@ func StubBackupConfig() func() {
2121
func StubWriteConfig(wc io.Writer, wh io.Writer) func() {
2222
orig := WriteConfigFile
2323
WriteConfigFile = func(fn string, data []byte) error {
24-
switch path.Base(fn) {
24+
switch filepath.Base(fn) {
2525
case "config.yml":
2626
_, err := wc.Write(data)
2727
return err
@@ -40,7 +40,7 @@ func StubWriteConfig(wc io.Writer, wh io.Writer) func() {
4040
func stubConfig(main, hosts string) func() {
4141
orig := ReadConfigFile
4242
ReadConfigFile = func(fn string) ([]byte, error) {
43-
switch path.Base(fn) {
43+
switch filepath.Base(fn) {
4444
case "config.yml":
4545
if main == "" {
4646
return []byte(nil), os.ErrNotExist

0 commit comments

Comments
 (0)
X Tutup