File: test-uninstall.R

package info (click to toggle)
r-cran-devtools 2.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,328 kB
  • sloc: sh: 15; makefile: 5
file content (13 lines) | stat: -rw-r--r-- 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
test_that("uninstall() unloads and removes from library", {
  withr::local_temp_libpaths()

  # Install package
  install(test_path("testHelp"), quiet = TRUE)
  expect_true(require(testHelp, quietly = TRUE))
  expect_true("testHelp" %in% loaded_packages()$package)

  # Uninstall package
  uninstall(test_path("testHelp"), quiet = TRUE)
  expect_false("testHelp" %in% loaded_packages()$package)
  suppressWarnings(expect_false(require(testHelp, quietly = TRUE)))
})