drake (version 6.2.1)

test_with_dir: Run a unit test in a way that quarantines the side effects from your workspace and file system.

Description

Typical users of drake should not need this function. It is exported so it can be used to quarantine the side effects of the examples in the help files.

Usage

test_with_dir(desc, ...)

Arguments

desc

character, description of the test

...

code to test

Value

Nothing.

Examples

Run this code
# NOT RUN {
test_with_dir(
  "Write a file to a temporary folder",
  writeLines("hello", "world.txt")
)
file.exists("world.txt") # FALSE
# }

Run the code above in your browser using DataCamp Workspace