tests/testthat/test_generateUnitTestFile.R

context("generateUnitTestFile")

test_that("generateUnitTestFile", {
  expect_output(generateUnitTestFile(file.path(tempdir(), 'x'), 'x <- 2', FALSE, TRUE))
  expect_type(generateUnitTestFile(file.path(tempdir(), 'test_x'), 'x <- 2'), 'list')
  expect_type(generateUnitTestFile(file.path(tempdir(), 'x.R'), 'x <- 2'), 'list')
  expect_type(generateUnitTestFile(file.path(tempdir(), 'test_x.R'), 'x <- 2'), 'list')
})

Try the wyz.code.testthat package in your browser

Any scripts or data that you put into this service are public.

wyz.code.testthat documentation built on Oct. 6, 2021, 9:07 a.m.