Skip to content

Commit

Permalink
convert to rds version 2 for backward compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzwalthert committed Jun 19, 2019
1 parent de29817 commit c5d9e8c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ testthat_file <- function(...) {
file.path(rprojroot::find_testthat_root_file(), ...)
}

#' Convert a serialized R object to a certaion verion.
#'
#' Needed to make [testthat::exect_known_value()] work on R < 3.6.
#' @param path A path to an rds file.
#' @param version The target version.
rds_to_version <- function(path, version = 2) {
readRDS(path) %>%
saveRDS(path, version = version)
}



#' Copy a file to a temporary directory
#'
Expand Down
16 changes: 16 additions & 0 deletions man/rds_to_version.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c5d9e8c

Please sign in to comment.