tests/testthat/test-is_a_rds_list.R

# WARNING - Generated by {fusen} from dev/flat_utils.Rmd: do not edit by hand

tmp <- gsub("[: ]", "_", Sys.time())
file.create(paste0(tmp, ".RDS"))
test_that("is_a_rds_list works", {
  expect_true(
    is_a_rds_list(list(paste0(tmp, ".RDS")))
  )
})
file.remove(paste0(tmp, ".RDS"))
test_that("is_a_rds_list fails", {
  expect_error(
    is_a_rds_list(list(T)),
    "The list does not contain characters"
  )
  expect_error(
    is_a_rds_list(list("test.RDS", "foo.bar")),
    "The list contains paths that do not end with the expected .RDS suffix."
  )
  expect_error(
    is_a_rds_list(list("does-not-exists.RDS", "does-not-exists-also.RDS")),
    "The list contains paths pointing to RDS files that do not exist."
  )
})

Try the maldipickr package in your browser

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

maldipickr documentation built on Sept. 13, 2024, 1:12 a.m.