vt_use_test_case | R Documentation |
Create a validation requirement, test case, or test code file
vt_use_test_case(
name,
username = vt_username(),
title = NULL,
open = interactive(),
add_before = NULL,
add_after = NULL
)
vt_use_test_code(
name,
username = vt_username(),
open = interactive(),
add_before = NULL,
add_after = NULL
)
vt_use_req(
name,
username = vt_username(),
title = NULL,
open = interactive(),
add_before = NULL,
add_after = NULL
)
name |
The name/path of the validation item. These can be named with your
file system separator and will be organized as a directory structure. Items
are located at |
username |
The username to insert into the validation item as the author. |
title |
Title for the requirement defaults to be the base name passed sans file paths or extensions. |
open |
Should the newly made file be opened for editing. |
add_before , add_after |
If either parameters is supplied, the location to add the validation item to the validation configuration. If no parameter is passed the item is added at the end. |
Path to the newly created validation item file, invisibly.
withr::with_tempdir({
vt_create_package("example.package")
setwd("example.package")
vt_add_user_to_config(
username = whoami::username(),
name = "Sample Name",
title = "Sample",
role = "example"
)
# Create req at the cases top level `inst/validation/cases/case1`
vt_use_test_case("case1", open = FALSE)
# Create req at `inst/validation/cases/regTests/Update2/case2`
vt_use_test_case("regTests/Update2/case2", open = FALSE, add_before = "case1.md")
# Create a test case using tidy select
vt_use_test_case("case1a", open = FALSE, add_after = tidyselect::starts_with("case1"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.