diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2020-08-04 18:10:36 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2020-08-05 13:23:21 +0300 |
commit | 33801fe9ba05c4bd304ebd8e40eb1337309f6b48 (patch) | |
tree | b87bdce7099c8f8c11ba9ecfe0ba81470ce38258 /internal/source/disk/map_test.go | |
parent | b2922c74ae775f4a56c784572c6672fa2c7332fa (diff) |
Fix tests that use illegal ../ paths
Diffstat (limited to 'internal/source/disk/map_test.go')
-rw-r--r-- | internal/source/disk/map_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/source/disk/map_test.go b/internal/source/disk/map_test.go index d2162883..4b9d6a23 100644 --- a/internal/source/disk/map_test.go +++ b/internal/source/disk/map_test.go @@ -11,6 +11,8 @@ import ( "github.com/karrick/godirwalk" "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" ) func getEntries(t require.TestingT) godirwalk.Dirents { @@ -179,7 +181,7 @@ func recvTimeout(t *testing.T, ch <-chan Map) Map { } } -func buildFakeDomainsDirectory(t require.TestingT, nGroups, levels int) func() { +func buildFakeDomainsDirectory(t testing.TB, nGroups, levels int) func() { testRoot, err := ioutil.TempDir("", "gitlab-pages-test") require.NoError(t, err) @@ -197,7 +199,7 @@ func buildFakeDomainsDirectory(t require.TestingT, nGroups, levels int) func() { } } - cleanup := chdirInPath(t, testRoot) + cleanup := testhelpers.ChdirInPath(t, testRoot, &chdirSet) return func() { defer cleanup() |