knitr::opts_chunk$set( error = TRUE, collapse = TRUE, comment = "#>", out.width = "100%" )
library(testthat) library(jeksterslabRterm) library(jeksterslabRutils) context("Test term_renviron.")
tmp <- file.path( tempdir(), util_rand_str() ) dir.create(tmp) on.exit( unlink( tmp, recursive = TRUE ) ) fn_renviron <- file.path( tmp, ".Renviron" ) libpath <- file.path( tmp, "lib" )
term_renviron( dir = tmp, overwrite = TRUE, GITHUB_PAT = "123456", libpath = libpath )
For code coverage.
suppressMessages( term_renviron( overwrite = FALSE ) )
test_that(".Renviron", { expect_true( file.exists(fn_renviron) ) })
test_that("warning", { expect_warning( term_renviron( dir = tmp, overwrite = FALSE, GITHUB_PAT = "123456", libpath = file.path(tmp, "tmp") ) ) })
unlink( c( fn_renviron, tmp, libpath ), recursive = TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.