Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testhelpers')
-rw-r--r--internal/testhelpers/testhelpers.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/testhelpers/testhelpers.go b/internal/testhelpers/testhelpers.go
index f731166b..3ec97a79 100644
--- a/internal/testhelpers/testhelpers.go
+++ b/internal/testhelpers/testhelpers.go
@@ -63,8 +63,17 @@ func AssertLogContains(t *testing.T, wantLogEntry string, entries []*logrus.Entr
func ToFileProtocol(t *testing.T, path string) string {
t.Helper()
+ wd := Getwd(t)
+
+ return fmt.Sprintf("file://%s/%s", wd, path)
+}
+
+// Getwd must return current working directory
+func Getwd(t *testing.T) string {
+ t.Helper()
+
wd, err := os.Getwd()
require.NoError(t, err)
- return fmt.Sprintf("file://%s/%s", wd, path)
+ return wd
}