context("Downloading files")
#### Tests
test_that("JDownload works", {
.prepare()
file <- JDownload("https://farm5.staticflickr.com/4507/37847388931_959d812490_o_d.jpg",
cacheDir = TEST_DIR, verbose = FALSE, debug = FALSE)
expect_true(!is.null(file))
expect_true(file.exists(file), "First file download failed")
info <- file.info(file)
file2 <- JDownload("https://farm5.staticflickr.com/4507/37847388931_959d812490_o_d.jpg",
cacheDir = TEST_DIR, verbose = FALSE, debug = FALSE)
expect_true(!is.null(file2))
expect_true(file.exists(file2), "Second file download failed")
info2 <- file.info(file)
# For some reason, this fails on Travis CI (Ubuntu)
# I can't work out why :()
#expect_equal(file, file2)
expect_equal(info$size, info2$size)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.