Skip to content

Commit

Permalink
remove testing dep from fsondisk
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Aug 1, 2022
1 parent e57b5d2 commit ff4f5cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
6 changes: 4 additions & 2 deletions kyaml/filesys/fsondisk_test.go
Expand Up @@ -58,7 +58,8 @@ func TestCleanedAbs_2(t *testing.T) {
req := require.New(t)
fSys, _ := makeTestDir(t)

root := getOSRoot(t)
root, err := getOSRoot()
req.NoError(err)
d, f, err := fSys.CleanedAbs(root)
req.NoError(err)
req.Equal(root, d.String())
Expand Down Expand Up @@ -122,7 +123,8 @@ func TestConfirmDirDisk(t *testing.T) {
err = os.Symlink(filepath.Join(wd, relDir), linkDir)
req.NoError(err)

root := getOSRoot(t)
root, err := getOSRoot()
req.NoError(err)
tests := map[string]*struct {
path string
expected string
Expand Down
Expand Up @@ -8,10 +8,8 @@ package filesys

import (
"path/filepath"
"testing"
)

func getOSRoot(t *testing.T) string {
t.Helper()
return string(filepath.Separator)
func getOSRoot() (string, error) {
return string(filepath.Separator), nil
}
Expand Up @@ -5,16 +5,11 @@ package filesys

import (
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
"golang.org/x/sys/windows"
)

func getOSRoot(t *testing.T) string {
t.Helper()

func getOSRoot() (string, error) {
sysDir, err := windows.GetSystemDirectory()
require.NoError(t, err)
return filepath.VolumeName(sysDir) + `\`
return filepath.VolumeName(sysDir) + `\`, err
}

0 comments on commit ff4f5cb

Please sign in to comment.