check_library: Check whether the library function was called correctly

View source: R/check-library-function.R

check_libraryR Documentation

Check whether the library function was called correctly

Description

Convenience function to test in a very hacky way whether the library function was called correctly in its most simple form. There is support for the different ways to call the library function

Usage

check_library(state, package, not_called_msg = NULL,
  incorrect_msg = NULL)

Arguments

state

state to start from

package

package name for which the library() function should've been called

not_called_msg

optional feedback message in case the library function wasn't called a single time

incorrect_msg

optional feedback message in case the library function wasn't called for the specified package.

Examples

## Not run: 
# example solution
library(ggvis)

# sct to test whether ggvis was loaded
ex() %>% check_library("ggvis")

## End(Not run)


datacamp/testwhat documentation built on June 26, 2022, 9:07 a.m.