Skip to content

Commit 60da741

Browse files
ensure that source files are in root/rpkg, i.e. where the R package is, not one level above
1 parent 1a42691 commit 60da741

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/testthat/test-hooks.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,29 @@ run_test("deps-in-desc",
216216
# in sub directory with wrong root
217217
run_test("deps-in-desc",
218218
suffix = "-fail.R", std_err = "contains a file",
219+
file_transformer = function(files) {
220+
fs::path_abs(fs::file_move(files, "rpkg"))
221+
},
219222
artifacts = c("rpkg/DESCRIPTION" = test_path("in/DESCRIPTION"))
220223
)
221224

222225
# in sub directory with correct root
223226
run_test("deps-in-desc",
224227
cmd_args = "--root=rpkg",
225228
suffix = "-fail.R", std_err = "Dependency check failed",
229+
file_transformer = function(files) {
230+
fs::path_abs(fs::file_move(files, "rpkg"))
231+
},
226232
artifacts = c("rpkg/DESCRIPTION" = test_path("in/DESCRIPTION"))
227233
)
228234

229235
# in sub directory with correct root
230236
run_test("deps-in-desc",
231237
cmd_args = "--root=rpkg",
232238
suffix = "-success.R", std_err = NULL,
239+
file_transformer = function(files) {
240+
fs::path_abs(fs::file_move(files, "rpkg"))
241+
},
233242
artifacts = c("rpkg/DESCRIPTION" = test_path("in/DESCRIPTION"))
234243
)
235244

0 commit comments

Comments
 (0)