vignettes/tests/test_term_rprofile.Rmd
test_term_rprofile.Rmd
library(testthat) library(jeksterslabRterm) library(jeksterslabRutils) context("Test term_rprofile.")
tmp <- file.path( tempdir(), util_rand_str() ) dir.create(tmp) on.exit( unlink( tmp, recursive = TRUE ) ) fn_rprofile <- file.path( tmp, ".Rprofile" )
term_rprofile( dir = tmp, overwrite = TRUE ) #> Output file: /tmp/RtmpQuJ0wR/ftikMYbi/.Rprofile
test_that(".Rprofile", { expect_true( file.exists(fn_rprofile) ) })
test_that("warning", { expect_warning( term_rprofile( dir = tmp, overwrite = FALSE ) ) })