tests/testthat/helper-thor.R

new_empty_dir <- function(...) {
  path <- tempfile(...)
  dir.create(path)
  path
}

expect_object_docs <- function(object) {
  m <- unlist(object$public_fields$.methods, use.names = FALSE)
  methods <- ls(object$public_methods)

  sys <- c("initialize", "finalize", "format")

  testthat::expect_equal(setdiff(m, methods), character(0))
  testthat::expect_equal(setdiff(methods, c(sys, m)), character(0))
}

test_not_empty <- function() {
  expect_true(TRUE)
}

Try the thor package in your browser

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

thor documentation built on Feb. 16, 2023, 9:37 p.m.