Skip to content

Commit bbee099

Browse files
committed
Pkg: Use ProjectRoot variable in path_test.go
Signed-off-by: Michael Mayer <[email protected]>
1 parent 3874bc5 commit bbee099

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/clean/clean_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package clean
2+
3+
import (
4+
"path/filepath"
5+
)
6+
7+
// ProjectRoot references the project root directory for use in tests.
8+
var ProjectRoot = func() string { dir, _ := filepath.Abs("../../"); return dir }()

pkg/clean/path_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func TestPath(t *testing.T) {
1010
t.Run("ValidPath", func(t *testing.T) {
11-
assert.Equal(t, "/go/src/github.com/photoprism/photoprism", Path("/go/src/github.com/photoprism/photoprism"))
11+
assert.Equal(t, ProjectRoot, Path(ProjectRoot))
1212
})
1313
t.Run("ValidFile", func(t *testing.T) {
1414
assert.Equal(t, "filename.TXT", Path("filename.TXT"))

0 commit comments

Comments
 (0)