Nothing
# Author: TW
#require(testthat)
context("getExamplePath")
# TRUE during testthat::check()
isNotOnCRAN <- identical(Sys.getenv("NOT_CRAN"), "true")
test_that("NOT_CRAN true",{
skip_on_cran()
formerEnv <- Sys.getenv("NOT_CRAN")
tryCatch({
Sys.setenv(NOT_CRAN = "true")
exDir <- getREddyProcExampleDir()
# dirname on a directory returns the parent directory
expect_equal( file.path(dirname(tempdir()),"REddyProcExamples"), exDir)
fName <- "readme.txt"
fPath <- file.path(exDir,fName)
# first make sure example is not there
unlink(fPath)
# get path without trying to download
exPath <- getExamplePath( fName, FALSE )
expect_equal( exPath, character(0))
# get path with trying to download
exPath <- getExamplePath( fName, TRUE )
expect_equal( exPath, fPath)
}
, finally = Sys.setenv(NOT_CRAN = formerEnv) )
})
test_that("NOT_CRAN undefined",{
skip_on_cran()
formerEnv <- Sys.getenv("NOT_CRAN")
tryCatch({
Sys.setenv(NOT_CRAN = "")
exDir <- getREddyProcExampleDir()
expect_equal( file.path(tempdir(),"REddyProcExamples"), exDir)
fName <- "readme.txt"
fPath <- file.path(exDir,fName)
# first make sure example is not there
unlink(fPath)
# get path without trying to download
exPath <- getExamplePath( fName, FALSE )
expect_equal( exPath, character(0))
# get path with trying to download
exPath <- getExamplePath( fName, TRUE )
expect_equal( exPath, fPath)
}
, finally = Sys.setenv(NOT_CRAN = formerEnv) )
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.