tests/testthat/test-url-path.R

library(testthat)
library(campfin)
library(fs)

test_that("file paths can be created from url basenames", {
  skip_if_offline()
  url <- "https://raw.githubusercontent.com/irworkshop/campfin/master/README.md"
  dir_create("dir")
  path <- url2path(url, "dir")
  download.file(url, path, quiet = TRUE)
  expect_true(file_exists("dir/README.md"))
  dir_delete("dir")
})

Try the campfin package in your browser

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

campfin documentation built on Oct. 20, 2023, 5:06 p.m.