Skip to content

Commit 183effb

Browse files
committed
try fix mac os test by changing expected value to computed relative path
as when getwd() and tmpdir() are on different drive, this could lead to issues
1 parent fcea57e commit 183effb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/testthat/test-utils-projects.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ test_that("project_path() works with explicit root", {
33
withr::local_dir(temp_dir)
44
expect_identical(
55
project_path("data", "file.csv", root = temp_dir),
6-
file.path("data", "file.csv")
6+
xfun::relative_path(file.path("data", "file.csv"), dir = temp_dir)
77
)
88
expect_identical(
99
project_path("outputs", "figures", "plot.png", root = temp_dir),
10-
file.path("outputs", "figures", "plot.png")
10+
xfun::relative_path(
11+
file.path("outputs", "figures", "plot.png"),
12+
dir = temp_dir
13+
)
1114
)
1215
expect_identical(project_path(root = temp_dir), ".")
1316
})

0 commit comments

Comments
 (0)