tests/testthat/test-use_here.R

test_that("`stash()` uses the `here::here()` function", {
  expect_message(
    use_here(),
    "global option \"mustashe.here\" has been set `TRUE`"
  )
  expect_silent(use_here(silent = TRUE))
  expect_true(getOption("mustashe.here"))

  dont_use_here(silent = TRUE)
})


test_that("`stash()` does not use the `here::here()` function", {
  expect_message(dont_use_here())
  expect_silent(dont_use_here(silent = TRUE))
  expect_false(getOption("mustashe.here"))

  dont_use_here(silent = TRUE)
})

Try the mustashe package in your browser

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

mustashe documentation built on May 17, 2021, 1:09 a.m.