library(testthat)
library(jeksterslabRterm)
library(jeksterslabRutils)
context("Test term_vim.")

Set test parameters

tmp <- file.path(
  tempdir(),
  util_rand_str()
)
dir.create(tmp)
on.exit(
  unlink(
    tmp,
    recursive = TRUE
  )
)
fn_vimrc <- file.path(
  tmp,
  ".vimrc"
)

Run test

term_vim(
  dir = tmp,
  overwrite = TRUE,
  plugins = FALSE
)
#> Output file: /tmp/RtmpQZYxj2/dZWgbiXY/.vimrc
test_that(".vimrc", {
  expect_true(
    file.exists(fn_vimrc)
  )
})
test_that("warning", {
  expect_warning(
    term_vim(
      dir = tmp,
      overwrite = FALSE,
      plugins = FALSE
    )
  )
})
unlink(
  c(
    fn_vimrc,
    tmp
  ),
  recursive = TRUE
)