Closed joethorley closed 4 years ago
skip("only works when run at console") tempdir <- file.path(tempdir(), "sims") unlink(tempdir, recursive = TRUE) teardown(unlink(tempdir, recursive = TRUE)) set.seed(1) dir.create(tempdir) wd <- setwd(tempdir) on.exit(setwd(wd)) expect_true(sims_simulate("a ~ dunif(0,1)", save = TRUE, exists = NA, ask = FALSE)) print(list.files(tempdir, all.files = TRUE, recursive=TRUE)) expect_identical(list.files(tempdir, all.files = TRUE, recursive=TRUE), c(".sims.rds", "data0000001.rds"))
I think this is fine - something to do with dir.create() or setwd()