Cache Cleanup After Tests
This release makes sure that the tests, examples, and vignette all use a temporary directory when running, so that it can be cleaned up correctly. This relies on withr
like this:
pth <- withr::local_tempdir(pattern = "snvecR")
withr::local_options(snvecR.cachedir = pth)
These make sure the directory is automatically removed after the test/example/vignette has run.
The cachedir()
function now listens to the package option snvecR.cachedir
to determine the user's cache directory. This can be set with options(snvecR.cachedir = "/path/to/desired/cachedir")
.
It still defaults to the result of tools::R_user_dir("snvecR", which = "cache")
.
See also this section of the r-pkgs book and this section on how to clean up after tests.