tests/testthat/test-template.R

context('template')

test_that('report template works',{
  
  temp_path <- tempdir()
  
  template('report test',
           path = temp_path,
           type = 'report',
           renv = TRUE,
           github = FALSE,
           start = FALSE)
  
  temp_dirs <- list.dirs(temp_path,recursive = FALSE)
  
  expect_true(TRUE %in% stringr::str_detect(temp_dirs,'report_test'))
})

test_that('presentation template works',{
  
  temp_path <- tempdir()
  
  template('presentation test',
           path = temp_path,
           type = 'presentation',
           renv = TRUE,
           github = FALSE,
           start = FALSE)
  
  temp_dirs <- list.dirs(temp_path,recursive = FALSE)
  
  expect_true(TRUE %in% stringr::str_detect(temp_dirs,'presentation_test'))
})

test_that('manuscript template works',{
  
  temp_path <- tempdir()
  
  template('manuscript test',
           path = temp_path,
           type = 'manuscript',
           renv = TRUE,
           github = FALSE,
           start = FALSE)
  
  temp_dirs <- list.dirs(temp_path,recursive = FALSE)
  
  expect_true(TRUE %in% stringr::str_detect(temp_dirs,'manuscript_test'))
})
jasenfinch/projecttemplates documentation built on July 30, 2023, 5:28 a.m.