tests/acceptance/setup.R

get_repo <- function(url) {
  parts <- strsplit(url, "/")[[1]]
  zip <- parts[length(parts)]
  withr::with_dir(fs::path(tempdir()), {
    tryCatch(
      download.file(url = url, destfile = zip, quiet = TRUE),
      error = function(e) {
        testthat::skip(paste("Failed to download repository from", url))
      }
    )
    path <- unzip(zipfile = zip)
  })
  fs::path(tempdir(), fs::path_common(path))
}

Try the muttest package in your browser

Any scripts or data that you put into this service are public.

muttest documentation built on June 8, 2025, 9:32 p.m.