tests/testthat/helper-model.R

model_checks <- function(model,
                         model_class,
                         function_args) {
  expect_failure(expect_s3_class(model, NA))
  expect_s3_class(model, model_class, exact = TRUE)

  expect_true(is.list(model))
  expect_identical(names(model), function_args)
  for (i in names(model)) expect_identical(model[[i]], 1)
}

Try the beaver package in your browser

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

beaver documentation built on May 29, 2024, 1:49 a.m.