packrat/lib/x86_64-pc-linux-gnu/3.2.2/packrat/tests/testthat/test-packrat-mode.R

context("packrat mode")

test_that("packrat_mode successfully sets the library paths when turned on and off", {

  with_dir(tempdir(), {

    ## Make sure packrat mode is off
    if (packrat:::isPackratModeOn())
      packrat::off()

    orig_libs <- getLibPaths()

    # don't use packrat::on so we can avoid the initialization step
    packrat:::setPackratModeOn(auto.snapshot = FALSE, clean.search.path = FALSE)

    packrat::off()

    expect_identical(orig_libs, getLibPaths())

  })

})
etsakl/DasyMapR documentation built on May 16, 2019, 9:07 a.m.