tests/testthat/test-package.R

local_load_all_quiet()

test_that("it can load from outside of package root", {
  expect_false('testHooks' %in% loadedNamespaces())
  load_all(file.path("testHooks"))

  expect_true('testHooks' %in% loadedNamespaces())
  expect_true(is_dev_package("testHooks"))

  unload(file.path("testHooks"))
  expect_false('testHooks' %in% loadedNamespaces())
})

Try the pkgload package in your browser

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

pkgload documentation built on June 28, 2024, 5:07 p.m.