R Under development (unstable) (2024-09-18 r87177 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(REDCapExporter) > > # Expect error if the input in not csv or json. the error should come from the > # read_text call, which is not exported. > x <- avs_raw_metadata > attr(x, "Content-Type") <- c("not-csv", "not-json") > x <- tools::assertError(REDCapExporter:::read_text(x)) > stopifnot(identical(x[[1]][["message"]], "Content-Type 'not-csv' is not yet supported.")) > > # Testing coercion of rcer_raw_metadata to data.frame and data.table > DF0 <- as.data.frame(avs_raw_metadata) > DF1 <- as.data.frame(avs_raw_metadata_json) > > stopifnot(all.equal(DF0, DF1)) > > # Testing coercion of rcer_raw_record to data.frame and data.table > rm(list = ls()) > > DF0 <- as.data.frame(avs_raw_record) > DF1 <- as.data.frame(avs_raw_record_json) > > stopifnot(all.equal(DF0, DF1)) > > # Testing coercion of rcer_raw_project to data.frame and data.table > rm(list = ls()) > DF0 <- as.data.frame(avs_raw_project) > DF1 <- as.data.frame(avs_raw_project_json) > > stopifnot(all.equal(DF0, DF1)) > > # Testing coercion of rcer_raw_user to data.frame and data.table > rm(list = ls()) > DF0 <- as.data.frame(avs_raw_user) > DF1 <- as.data.frame(avs_raw_user_json) > > stopifnot(all.equal(DF0, DF1)) > > > proc.time() user system elapsed 0.65 0.10 0.75