tests/testthat/test_check_installed.R

library(martini)

test_that("detects when a package is not installed", {
  
  expect_error(check_installed("fake package 123"), "fake package 123 needed for this function to work. Please install it.")
  expect_error(check_installed("fake package 123", "fake fun"), "fake package 123 needed for fake fun to work. Please install it.")
  expect_error(check_installed("martini"), NA)
  
})

Try the martini package in your browser

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

martini documentation built on Nov. 8, 2020, 5:39 p.m.