diff --git a/tests/test-build_r_pkg.R b/tests/test-build_r_pkg.R new file mode 100644 index 0000000..13fccb9 --- /dev/null +++ b/tests/test-build_r_pkg.R @@ -0,0 +1,29 @@ +library(REDCapExporter) +temppath <- tempdir() +build_r_data_package( + x = avs_raw_core, + path = temppath, + author_roles = list(dewittp = c("cre", "aut")), +) + +x <- fs::dir_tree(temppath) +x <- substr(x, start = nchar(temppath) + 1, stop = nchar(x)) +x <- as.character(x) + +stopifnot( + identical( + x, + c("rcd14465", "rcd14465/DESCRIPTION", "rcd14465/LICENSE", "rcd14465/NAMESPACE", + "rcd14465/R", "rcd14465/R/datasets.R", "rcd14465/data", "rcd14465/data/metadata.rda", + "rcd14465/data/project.rda", "rcd14465/data/record.rda", "rcd14465/data/user.rda", + "rcd14465/inst", "rcd14465/inst/raw-data", "rcd14465/inst/raw-data/metadata.rds", + "rcd14465/inst/raw-data/project.rds", "rcd14465/inst/raw-data/record.rds", + "rcd14465/inst/raw-data/user.rds", "rcd14465/man", "rcd14465/man/metadata.Rd", + "rcd14465/man/project.Rd", "rcd14465/man/record.Rd", "rcd14465/man/user.Rd") + ) +) + +stopifnot( + packageDescription(pkg = "rcd14465", lib.loc = temppath)$Package == "rcd14465", + grepl("\\d{4}\\.\\d{2}\\.\\d{2}\\.\\d{2}\\.\\d{2}", packageDescription(pkg = "rcd14465", lib.loc = temppath)$Version) + ) diff --git a/vignette-spinners/redcap2package.R b/vignette-spinners/redcap2package.R index ab59697..c3a32c4 100644 --- a/vignette-spinners/redcap2package.R +++ b/vignette-spinners/redcap2package.R @@ -76,8 +76,7 @@ temppath <- tempdir() build_r_data_package( x = avs_raw_core, path = temppath, - author_roles = list(dewittp = c("cre", "aut")), - class = "data.frame" # format data as data.frames + author_roles = list(dewittp = c("cre", "aut")) ) #' diff --git a/vignettes/redcap2package.Rmd b/vignettes/redcap2package.Rmd index 9adba49..36627a5 100644 --- a/vignettes/redcap2package.Rmd +++ b/vignettes/redcap2package.Rmd @@ -80,8 +80,7 @@ temppath <- tempdir() build_r_data_package( x = avs_raw_core, path = temppath, - author_roles = list(dewittp = c("cre", "aut")), - class = "data.frame" # format data as data.frames + author_roles = list(dewittp = c("cre", "aut")) ) ```