assert_pkg_path: Assertions for pkg and pkg_path in packager_functions

View source: R/assert_arguments.R

assert_pkg_pathR Documentation

Assertions for pkg and pkg_path in packager_functions

Description

Assertions for pkg and pkg_path in packager_functions.

Usage

assert_pkg_path(pkg, pkg_path, add)

Arguments

pkg

[any]
Argument to the add-function to be asserted.

pkg_path

[any]
Argument to the add-function to be asserted.

add

[AssertCollection]
The AssertCollection for saving result of assertions.

Details

The function does not set up and report the AssertCollection This need to be done separately, see example.

Value

An AssertCollection that have been updated with the results of assertions for pkg and pkg_path.

Author(s)

Petter Hopp Petter.Hopp@vetinst.no

Examples

# Attach package and make temporary directory
library(NVIpackager)
td <- tempdir()
if (!dir.exists(file.path(td, "NVItest"))) {
  dir.create(file.path(td, "NVItest"))
}
# ARGUMENT CHECKING
# Object to store check-results
checks <- checkmate::makeAssertCollection()
# Perform checks
checks <- assert_pkg_path(pkg = "NVItest",
                pkg_path = paste0(td, "/NVItest"),
                add = checks)
# Report check-results
checkmate::reportAssertions(checks)

PetterHopp/NVIpackager documentation built on Sept. 14, 2024, 1:24 a.m.