tests/testthat/test-fold_accessors.R

context("Fold Accessors")

test_that("Error on no fold defined", {
  expect_error(training())
})

fold <- "garbage fold"
test_that("Error on garbage fold", {
  expect_error(training())
})

training_fun <- get_from_fold("training_set")
test_that("Function factory works", {
  expect_equal(training, training_fun)
})

Try the origami package in your browser

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

origami documentation built on Oct. 20, 2022, 1:07 a.m.