write_testfile: Write testdata to a file formatted for use with the testthat...

Description Usage Arguments Examples

View source: R/write_testfile.R

Description

Write testdata to a file formatted for use with the testthat package.

Usage

1
2
3
4
5
6
7
write_testfile(
  testdata,
  func_name,
  filename = NULL,
  filepath = NULL,
  overwrite = FALSE
)

Arguments

testdata

tibble

func_name

charater. The name of the function being tested. Typically the name of the sheet.

filename

character (vector). The default is testsheet_<sheet>.R. The number of given filenames must match the length of testdata.

filepath

character. The defallt is the current working directory

overwrite

boolean. The default is FALSE.

Examples

1
2
3
ss <- testsheets_example("google sheets")
testdata <- read_testsheet(ss, "sum")
write_testfile(testdata, "sum", filename="mycustomfile.R")

nicole-brewer/testsheets documentation built on Sept. 26, 2021, 6:46 a.m.