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())

    orig_libs <- getLibPaths()

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


    expect_identical(orig_libs, getLibPaths())



Try the packrat package in your browser

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

packrat documentation built on Jan. 10, 2023, 1:07 a.m.