Skip to content

Commit

Permalink
#178 change if block in helper-crul to catch bad URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Apr 2, 2024
1 parent 1f985dd commit 1e86684
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/testthat/helper-crul.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# skip_on_cran()

hb <- function(x = NULL) if (is.null(x)) base_url else paste0(base_url, x)

# check various httpbin servers
Expand All @@ -17,6 +15,6 @@ for (i in seq_along(urls)) {
)
}
codes <- vapply(out, "[[", 1, "status_code")
if (!any(codes == 200)) stop("all httpbin servers down")
if (all(codes != 200)) stop("all httpbin servers down")
base_url <- urls[codes == 200][1]
cat(paste0("using base url for tests: ", base_url), sep = "\n")

0 comments on commit 1e86684

Please sign in to comment.