tests/testthat/test-cache.R

context("cache")


test_that("cache path responds to option", {
  withr::with_options(
    list(montagu.cache_path = NULL), {
      location <- montagu_server("server", "address", global = FALSE)
      expect_is(location$cache, "storr")
      expect_equal(location$cache$driver$type(), "environment")
    })

  path <- tempfile()
  withr::with_options(
    list(montagu.cache_path = path), {
      location <- montagu_server("server", "address", global = FALSE)
      expect_is(location$cache, "storr")
      expect_equal(location$cache$driver$type(), "rds")
    })
})
vimc/montagu-r documentation built on Oct. 10, 2019, 9:10 p.m.