From 6fc3ad97dc69e071d7f855c6fc826dfdf56cb30d Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Wed, 27 Sep 2023 14:31:34 +0200 Subject: [PATCH 1/5] Not using ... ref #110 --- R/use_rang.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/use_rang.R b/R/use_rang.R index 9d8ab41..131d58e 100644 --- a/R/use_rang.R +++ b/R/use_rang.R @@ -80,7 +80,7 @@ use_rang <- function(path = ".", add_makefile = TRUE, add_here = TRUE, #' [The Turing Way: Research Compendia](https://the-turing-way.netlify.app/reproducible-research/compendia.html) #' Gorman, KB, Williams TD. and Fraser WR (2014). Ecological Sexual Dimorphism and Environmental Variability within a Community of Antarctic Penguins (Genus Pygoscelis). PLoS ONE 9(3):e90081. \doi{10.1371/journal.pone.0090081} #' @export -create_turing <- function(path, add_rang = TRUE, ...) { +create_turing <- function(path, add_rang = TRUE, add_makefile = TRUE, add_here = TRUE, verbose = TRUE, force = FALSE) { if (isTRUE(dir.exists(path))) { stop("`path` exists.") } @@ -91,7 +91,7 @@ create_turing <- function(path, add_rang = TRUE, ...) { dir.create(file.path(path, "figures")) dir.create(file.path(path, "data_clean")) if (isTRUE(add_rang)) { - use_rang(path, ...) + use_rang(path, add_makefile = add_makefile, add_here = add_here, verbose = verbose, force = force) } invisible(path) } From 5a4e5750f637f5c678adb9052eff3df670098244 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Wed, 27 Sep 2023 14:43:08 +0200 Subject: [PATCH 2/5] Update doc --- R/use_rang.R | 1 + man/create_turing.Rd | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/R/use_rang.R b/R/use_rang.R index 131d58e..da86dd2 100644 --- a/R/use_rang.R +++ b/R/use_rang.R @@ -59,6 +59,7 @@ use_rang <- function(path = ".", add_makefile = TRUE, add_here = TRUE, #' @param path character, path to the project root #' @param add_rang logical, whether to run [use_rang()] to `path` #' @param ... additional parameters pass to [use_rang()] +#' @inheritParams use_rang #' @return path, invisibly #' @seealso [use_rang()] #' @details diff --git a/man/create_turing.Rd b/man/create_turing.Rd index d2308e1..7d2b0e1 100644 --- a/man/create_turing.Rd +++ b/man/create_turing.Rd @@ -4,13 +4,29 @@ \alias{create_turing} \title{Create executable research compendium according to the Turing Way} \usage{ -create_turing(path, add_rang = TRUE, ...) +create_turing( + path, + add_rang = TRUE, + add_makefile = TRUE, + add_here = TRUE, + verbose = TRUE, + force = FALSE +) } \arguments{ \item{path}{character, path to the project root} \item{add_rang}{logical, whether to run \code{\link[=use_rang]{use_rang()}} to \code{path}} +\item{add_makefile}{logical, whether to insert a barebone \code{Makefile} in the project root.} + +\item{add_here}{logical, whether to insert a hidden \code{.here} file in the project root} + +\item{verbose}{logical, whether to print out messages} + +\item{force}{logical, whether to overwrite files (\code{inst/rang/update.R}, \code{Makefile}, \code{.here}) if they +exist.} + \item{...}{additional parameters pass to \code{\link[=use_rang]{use_rang()}}} } \value{ From 7feb212c3d5023ff425bcd231b13b4902e6656ce Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Wed, 27 Sep 2023 15:46:38 +0200 Subject: [PATCH 3/5] Correct docs --- R/use_rang.R | 1 - man/create_turing.Rd | 2 -- 2 files changed, 3 deletions(-) diff --git a/R/use_rang.R b/R/use_rang.R index da86dd2..7cc755e 100644 --- a/R/use_rang.R +++ b/R/use_rang.R @@ -58,7 +58,6 @@ use_rang <- function(path = ".", add_makefile = TRUE, add_here = TRUE, #' This `usethis`-style function creates an executable research compendium according to the Turing Way. #' @param path character, path to the project root #' @param add_rang logical, whether to run [use_rang()] to `path` -#' @param ... additional parameters pass to [use_rang()] #' @inheritParams use_rang #' @return path, invisibly #' @seealso [use_rang()] diff --git a/man/create_turing.Rd b/man/create_turing.Rd index 7d2b0e1..9597555 100644 --- a/man/create_turing.Rd +++ b/man/create_turing.Rd @@ -26,8 +26,6 @@ create_turing( \item{force}{logical, whether to overwrite files (\code{inst/rang/update.R}, \code{Makefile}, \code{.here}) if they exist.} - -\item{...}{additional parameters pass to \code{\link[=use_rang]{use_rang()}}} } \value{ path, invisibly From 98e03b0196f5e938a1d4339cd3c07fe346e29598 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Wed, 27 Sep 2023 16:28:29 +0200 Subject: [PATCH 4/5] Change the default CRAN_mirror --- DESCRIPTION | 3 ++- R/cache.R | 2 +- R/installation.R | 4 ++-- man/dockerize.Rd | 2 +- man/export_rang.Rd | 2 +- tests/testthat.R | 4 +++- tests/testthat/test_dockerize.R | 18 +++++++++--------- tests/testthat/test_expost_rang.R | 10 +++++----- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8b2d539..1e42e7f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,8 @@ BugReports: https://github.com/chainsawriot/rang/issues Suggests: knitr, rmarkdown, - testthat (>= 3.0.0) + testthat (>= 3.0.0), + withr Config/testthat/edition: 3 Imports: parsedate, diff --git a/R/cache.R b/R/cache.R index 7b47ed9..77505aa 100644 --- a/R/cache.R +++ b/R/cache.R @@ -3,7 +3,7 @@ NULL .query_mirror_validity <- function(mirror) { - if (mirror == "https://cran.r-project.org/") { + if (mirror %in% c("https://cran.r-project.org/", "https://cloud.r-project.org/")) { return(TRUE) } all_mirrors <- utils::getCRANmirrors()$URL diff --git a/R/installation.R b/R/installation.R index 87f4da5..4341a76 100644 --- a/R/installation.R +++ b/R/installation.R @@ -148,7 +148,7 @@ #' } #' } export_rang <- function(rang, path, rang_as_comment = TRUE, verbose = TRUE, lib = NA, - cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, + cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/") { if (.is_r_version_older_than(rang, "1.3.1")) { stop("`export_rang` doesn't support this R version (yet).") @@ -448,7 +448,7 @@ export_renv <- function(rang, path = ".") { dockerize <- function(rang, output_dir, materials_dir = NULL, post_installation_steps = NULL, image = c("r-ver", "rstudio", "tidyverse", "verse", "geospatial"), rang_as_comment = TRUE, cache = FALSE, verbose = TRUE, lib = NA, - cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, + cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/", no_rocker = FALSE, debian_version = c("lenny", "squeeze", "wheezy", "jessie", "stretch"), diff --git a/man/dockerize.Rd b/man/dockerize.Rd index 1df0093..6714f3c 100644 --- a/man/dockerize.Rd +++ b/man/dockerize.Rd @@ -17,7 +17,7 @@ dockerize( cache = FALSE, verbose = TRUE, lib = NA, - cran_mirror = "https://cran.r-project.org/", + cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/", no_rocker = FALSE, diff --git a/man/export_rang.Rd b/man/export_rang.Rd index c78fc3f..5c7e457 100644 --- a/man/export_rang.Rd +++ b/man/export_rang.Rd @@ -10,7 +10,7 @@ export_rang( rang_as_comment = TRUE, verbose = TRUE, lib = NA, - cran_mirror = "https://cran.r-project.org/", + cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/" ) diff --git a/tests/testthat.R b/tests/testthat.R index 700e159..d90a4ae 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -9,4 +9,6 @@ library(testthat) library(rang) -test_check("rang") +withr::with_options(new = list(repo = "https://cloud.r-project.org/"), { + test_check("rang") +}) diff --git a/tests/testthat/test_dockerize.R b/tests/testthat/test_dockerize.R index 479ce1f..52cbbb9 100644 --- a/tests/testthat/test_dockerize.R +++ b/tests/testthat/test_dockerize.R @@ -62,9 +62,9 @@ test_that("integration of #16 in dockerize()", { test_that("integration of #18 in dockerize()", { rang_ok <- readRDS("../testdata/rang_ok.RDS") temp_dir <- .generate_temp_dir() - dockerize(rang = rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" + dockerize(rang = rang_ok, output_dir = temp_dir) x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) dockerize(rang = rang_ok, output_dir = temp_dir, cran_mirror = "cran.r-project.org") x <- readLines(file.path(temp_dir, "rang.R")) expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) @@ -81,20 +81,20 @@ test_that("integration of #20 to dockerize()", { rang_ok <- readRDS("../testdata/rang_ok.RDS") expect_equal(rang_ok$r_version, "4.2.2") temp_dir <- .generate_temp_dir() - dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" + dockerize(rang_ok, output_dir = temp_dir) x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.3.0" - dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" + dockerize(rang_ok, output_dir = temp_dir) x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.2.0" - dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" + dockerize(rang_ok, output_dir = temp_dir) x <- readLines(file.path(temp_dir, "rang.R")) - expect_false(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) - expect_true(any(grepl("^cran.mirror <- \"http://cran\\.r\\-project\\.org/\"", x))) + expect_false(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"http://cloud\\.r\\-project\\.org/\"", x))) }) test_that("sugars", { diff --git a/tests/testthat/test_expost_rang.R b/tests/testthat/test_expost_rang.R index 3b84396..18a8f13 100644 --- a/tests/testthat/test_expost_rang.R +++ b/tests/testthat/test_expost_rang.R @@ -64,7 +64,7 @@ test_that("integration of mirror selection to `export_rang` #18", { temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) export_rang(rang_ok, path = temp_r, cran_mirror = "cran.r-project.org") x <- readLines(temp_r) expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) @@ -83,20 +83,20 @@ test_that("integration of https to `export_rang` #20", { temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.3.0" temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.2.0" temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_false(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) - expect_true(any(grepl("^cran.mirror <- \"http://cran\\.r\\-project\\.org/\"", x))) + expect_false(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"http://cloud\\.r\\-project\\.org/\"", x))) }) test_that("Docker R < 1.3.1", { From acf20a04f707b8dfe65437002475afdeaf4b47e5 Mon Sep 17 00:00:00 2001 From: chainsawriot Date: Wed, 27 Sep 2023 16:36:12 +0200 Subject: [PATCH 5/5] Revert "Change the default CRAN_mirror" This reverts commit 98e03b0196f5e938a1d4339cd3c07fe346e29598. --- DESCRIPTION | 3 +-- R/cache.R | 2 +- R/installation.R | 4 ++-- man/dockerize.Rd | 2 +- man/export_rang.Rd | 2 +- tests/testthat.R | 4 +--- tests/testthat/test_dockerize.R | 18 +++++++++--------- tests/testthat/test_expost_rang.R | 10 +++++----- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1e42e7f..8b2d539 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,8 +18,7 @@ BugReports: https://github.com/chainsawriot/rang/issues Suggests: knitr, rmarkdown, - testthat (>= 3.0.0), - withr + testthat (>= 3.0.0) Config/testthat/edition: 3 Imports: parsedate, diff --git a/R/cache.R b/R/cache.R index 77505aa..7b47ed9 100644 --- a/R/cache.R +++ b/R/cache.R @@ -3,7 +3,7 @@ NULL .query_mirror_validity <- function(mirror) { - if (mirror %in% c("https://cran.r-project.org/", "https://cloud.r-project.org/")) { + if (mirror == "https://cran.r-project.org/") { return(TRUE) } all_mirrors <- utils::getCRANmirrors()$URL diff --git a/R/installation.R b/R/installation.R index 4341a76..87f4da5 100644 --- a/R/installation.R +++ b/R/installation.R @@ -148,7 +148,7 @@ #' } #' } export_rang <- function(rang, path, rang_as_comment = TRUE, verbose = TRUE, lib = NA, - cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, + cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/") { if (.is_r_version_older_than(rang, "1.3.1")) { stop("`export_rang` doesn't support this R version (yet).") @@ -448,7 +448,7 @@ export_renv <- function(rang, path = ".") { dockerize <- function(rang, output_dir, materials_dir = NULL, post_installation_steps = NULL, image = c("r-ver", "rstudio", "tidyverse", "verse", "geospatial"), rang_as_comment = TRUE, cache = FALSE, verbose = TRUE, lib = NA, - cran_mirror = getOption("repos", "https://cloud.r-project.org/"), check_cran_mirror = TRUE, + cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/", no_rocker = FALSE, debian_version = c("lenny", "squeeze", "wheezy", "jessie", "stretch"), diff --git a/man/dockerize.Rd b/man/dockerize.Rd index 6714f3c..1df0093 100644 --- a/man/dockerize.Rd +++ b/man/dockerize.Rd @@ -17,7 +17,7 @@ dockerize( cache = FALSE, verbose = TRUE, lib = NA, - cran_mirror = getOption("repos", "https://cloud.r-project.org/"), + cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/", no_rocker = FALSE, diff --git a/man/export_rang.Rd b/man/export_rang.Rd index 5c7e457..c78fc3f 100644 --- a/man/export_rang.Rd +++ b/man/export_rang.Rd @@ -10,7 +10,7 @@ export_rang( rang_as_comment = TRUE, verbose = TRUE, lib = NA, - cran_mirror = getOption("repos", "https://cloud.r-project.org/"), + cran_mirror = "https://cran.r-project.org/", check_cran_mirror = TRUE, bioc_mirror = "https://bioconductor.org/packages/" ) diff --git a/tests/testthat.R b/tests/testthat.R index d90a4ae..700e159 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -9,6 +9,4 @@ library(testthat) library(rang) -withr::with_options(new = list(repo = "https://cloud.r-project.org/"), { - test_check("rang") -}) +test_check("rang") diff --git a/tests/testthat/test_dockerize.R b/tests/testthat/test_dockerize.R index 52cbbb9..479ce1f 100644 --- a/tests/testthat/test_dockerize.R +++ b/tests/testthat/test_dockerize.R @@ -62,9 +62,9 @@ test_that("integration of #16 in dockerize()", { test_that("integration of #18 in dockerize()", { rang_ok <- readRDS("../testdata/rang_ok.RDS") temp_dir <- .generate_temp_dir() - dockerize(rang = rang_ok, output_dir = temp_dir) + dockerize(rang = rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) dockerize(rang = rang_ok, output_dir = temp_dir, cran_mirror = "cran.r-project.org") x <- readLines(file.path(temp_dir, "rang.R")) expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) @@ -81,20 +81,20 @@ test_that("integration of #20 to dockerize()", { rang_ok <- readRDS("../testdata/rang_ok.RDS") expect_equal(rang_ok$r_version, "4.2.2") temp_dir <- .generate_temp_dir() - dockerize(rang_ok, output_dir = temp_dir) + dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.3.0" - dockerize(rang_ok, output_dir = temp_dir) + dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(file.path(temp_dir, "rang.R")) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.2.0" - dockerize(rang_ok, output_dir = temp_dir) + dockerize(rang_ok, output_dir = temp_dir) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(file.path(temp_dir, "rang.R")) - expect_false(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) - expect_true(any(grepl("^cran.mirror <- \"http://cloud\\.r\\-project\\.org/\"", x))) + expect_false(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"http://cran\\.r\\-project\\.org/\"", x))) }) test_that("sugars", { diff --git a/tests/testthat/test_expost_rang.R b/tests/testthat/test_expost_rang.R index 18a8f13..3b84396 100644 --- a/tests/testthat/test_expost_rang.R +++ b/tests/testthat/test_expost_rang.R @@ -64,7 +64,7 @@ test_that("integration of mirror selection to `export_rang` #18", { temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) export_rang(rang_ok, path = temp_r, cran_mirror = "cran.r-project.org") x <- readLines(temp_r) expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) @@ -83,20 +83,20 @@ test_that("integration of https to `export_rang` #20", { temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.3.0" temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_true(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) rang_ok <- readRDS("../testdata/rang_ok.RDS") rang_ok$r_version <- "3.2.0" temp_r <- tempfile(fileext = ".R") export_rang(rang_ok, path = temp_r) ## cran_mirror = "https://cran.r-project.org/" x <- readLines(temp_r) - expect_false(any(grepl("^cran.mirror <- \"https://cloud\\.r\\-project\\.org/\"", x))) - expect_true(any(grepl("^cran.mirror <- \"http://cloud\\.r\\-project\\.org/\"", x))) + expect_false(any(grepl("^cran.mirror <- \"https://cran\\.r\\-project\\.org/\"", x))) + expect_true(any(grepl("^cran.mirror <- \"http://cran\\.r\\-project\\.org/\"", x))) }) test_that("Docker R < 1.3.1", {