tests/testthat/test-tar_path_store.R

tar_test("tar_path_store() outside a pipeline", {
  skip_cran()
  expect_equal(tar_path_store(), tar_config_get("store"))
  tar_config_set(store = "example_store")
  expect_equal(tar_path_store(), tar_config_get("store"))
})

tar_test("tar_path_store() inside a pipeline", {
  skip_cran()
  tar_script(tar_target(x, tar_path_store()), ask = FALSE)
  store <- "example_store"
  tar_make(store = store, callr_function = NULL)
  expect_equal(tar_read(x, store = store), store)
})

Try the targets package in your browser

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

targets documentation built on Oct. 12, 2023, 5:07 p.m.