R Under development (unstable) (2026-03-08 r89578 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 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) > > # Unsupported content type should error > x_bad <- avs_raw_metadata > attr(x_bad, "Content-Type") <- c("not-csv", "not-json") > > err <- tryCatch( + REDCapExporter:::read_text(x_bad), + error = function(e) e + ) > > stopifnot( + inherits(err, "error"), + grepl("Content-Type .* not yet supported", err$message) + ) > > # Metadata coercion > md_csv <- as.data.frame(avs_raw_metadata) > md_json <- as.data.frame(avs_raw_metadata_json) > stopifnot(isTRUE(all.equal(md_csv, md_json))) > > # Record coercion > rec_csv <- as.data.frame(avs_raw_record) > rec_json <- as.data.frame(avs_raw_record_json) > stopifnot(isTRUE(all.equal(rec_csv, rec_json))) > > # Project coercion > proj_csv <- as.data.frame(avs_raw_project) > proj_json <- as.data.frame(avs_raw_project_json) > stopifnot(isTRUE(all.equal(proj_csv, proj_json))) > > # User coercion > usr_csv <- as.data.frame(avs_raw_user) > usr_json <- as.data.frame(avs_raw_user_json) > stopifnot(isTRUE(all.equal(usr_csv, usr_json))) > > > proc.time() user system elapsed 0.40 0.03 0.43