tests/testthat/test_helpers_general.R

context("generally useful heper functions")

# check_if_packages_are_available
test_that("check_if_packages_are_available works", {
  expect_silent(
    check_if_packages_are_available(c("c14bazAAR", "dplyr"))
  )
  expect_error(
    check_if_packages_are_available(c("abc", "def"))
  )
})

# check_if_columns_are_present
test_that("check_if_columns_are_present works", {
  expect_silent(
    check_if_columns_are_present(example_c14_date_list, c("feature", "period"))
  )
  expect_error(
    check_if_columns_are_present(example_c14_date_list, c("abc", "def"))
  )
})

# check_connection_to_url
test_that("check_connection_to_url works", {
  skip_on_cran()
  expect_silent(
    check_connection_to_url("www.google.com")
  )
  expect_error(
    check_connection_to_url("abc")
  )
})

Try the c14bazAAR package in your browser

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

c14bazAAR documentation built on March 26, 2020, 6:38 p.m.