tests/testthat/test-update_inits.R

test_that("update_inits works as expected", {
  
  # set temp dir
  temp_dir <- tempdir()
  
  script <- system.file("other", "run1.r", package = "shinyMixR")
  res <- system.file("other", "run1.res.rds", package = "shinyMixR")
  
  update_inits(readLines(script), res, paste0(temp_dir, "/run2.r"))
  
  # check if file has been written
  expect_true(file.exists(paste0(temp_dir, "/run2.r")))
  
  # unlink file
  unlink(paste0(temp_dir, "/run2.r"))
  
})

Try the shinyMixR package in your browser

Any scripts or data that you put into this service are public.

shinyMixR documentation built on April 12, 2025, 2:25 a.m.