From 815814579e6ae25b42e67641920bfd8b0bdc09d6 Mon Sep 17 00:00:00 2001 From: Maarten van Kessel Date: Fri, 29 Nov 2024 16:00:01 +0100 Subject: [PATCH] Updated tests --- CRAN-SUBMISSION | 6 +++--- tests/testthat/setup.R | 16 ++++++++++++---- tests/testthat/test-addPareArticle.R | 1 + tests/testthat/test-checkDependencies.R | 2 ++ tests/testthat/test-getApplyCall.R | 1 + tests/testthat/test-getDlplyCall.R | 1 + tests/testthat/test-getDoCall.R | 1 + tests/testthat/test-getFunCall.R | 1 + tests/testthat/test-getMultiLineFun.R | 1 + 9 files changed, 23 insertions(+), 7 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index d6e7e62..a323ba4 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.1.14 -Date: 2024-11-28 15:02:25 UTC -SHA: 6b421989f4c43662982bbe2723d109a843f5e982 +Version: 0.1.15 +Date: 2024-11-29 14:23:55 UTC +SHA: 92610472fed267d36c1e1d2ce5a421c6379a5565 diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 690e33c..484effe 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -3,12 +3,20 @@ library(testthat) library(git2r) path <- file.path(tempdir(), "glue") +repoCloned <- NULL if (!is.null(curl::nslookup("captive.apple.com", error = FALSE))) { - clone( - url = "https://github.com/tidyverse/glue", - local_path = path - ) + tryCatch({ + clone( + url = "https://github.com/tidyverse/glue", + local_path = path + ) + repoCloned <- TRUE + }, error = function(e) { + repoCloned <- FALSE + }) +} else { + repoCloned <- FALSE } withr::defer({ diff --git a/tests/testthat/test-addPareArticle.R b/tests/testthat/test-addPareArticle.R index 1268b0a..f45ab02 100644 --- a/tests/testthat/test-addPareArticle.R +++ b/tests/testthat/test-addPareArticle.R @@ -1,6 +1,7 @@ test_that("minimal", { skip_if_not(checkSuggests()) skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-checkDependencies.R b/tests/testthat/test-checkDependencies.R index b22e2cc..f66fce9 100644 --- a/tests/testthat/test-checkDependencies.R +++ b/tests/testthat/test-checkDependencies.R @@ -16,6 +16,7 @@ test_that("void", { test_that("minimal", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) @@ -28,6 +29,7 @@ test_that("minimal", { test_that("parallel", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-getApplyCall.R b/tests/testthat/test-getApplyCall.R index ca0cc68..f4c8316 100644 --- a/tests/testthat/test-getApplyCall.R +++ b/tests/testthat/test-getApplyCall.R @@ -1,5 +1,6 @@ test_that("minimal", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-getDlplyCall.R b/tests/testthat/test-getDlplyCall.R index dc853af..7236fb8 100644 --- a/tests/testthat/test-getDlplyCall.R +++ b/tests/testthat/test-getDlplyCall.R @@ -8,6 +8,7 @@ test_that("minimal", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-getDoCall.R b/tests/testthat/test-getDoCall.R index 9c162f8..fc1ee8c 100644 --- a/tests/testthat/test-getDoCall.R +++ b/tests/testthat/test-getDoCall.R @@ -1,5 +1,6 @@ test_that("minimal", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-getFunCall.R b/tests/testthat/test-getFunCall.R index 431212a..1af42fc 100644 --- a/tests/testthat/test-getFunCall.R +++ b/tests/testthat/test-getFunCall.R @@ -1,5 +1,6 @@ test_that("minimal", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path) diff --git a/tests/testthat/test-getMultiLineFun.R b/tests/testthat/test-getMultiLineFun.R index 7144186..0ad1a08 100644 --- a/tests/testthat/test-getMultiLineFun.R +++ b/tests/testthat/test-getMultiLineFun.R @@ -16,6 +16,7 @@ test_that("regular use", { skip_if_offline() + skip_if_not(repoCloned) repo <- Repository$new(path)