tests/testthat/test-skeleton.R

context("datapackage skeleton")

test_that("datapackage skeleton builds correct structure", {
  file <- system.file("extdata", "tests", "subsetCars.Rmd",
    package = "DataPackageR"
  )
  # normalizePath(tempdir(), winslash = "/", mustWork = TRUE)

  expect_null(
    datapackage_skeleton(
      name = "subsetCars",
      path = tempdir(),
      code_files = c(file),
      force = TRUE,
      r_object_names = "cars_over_20"
    )
  )
  unlink(file.path(tempdir(), "subsetCars"),
    recursive = TRUE,
    force = TRUE
  )
})

Try the DataPackageR package in your browser

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

DataPackageR documentation built on March 17, 2021, 5:07 p.m.