diff --git a/DESCRIPTION b/DESCRIPTION
index 8c10abe..a9dfd9a 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -38,9 +38,8 @@ Description: Automate the steps necessary to create a validation ready package
situations to provide documentation for validation.
License: MIT + file LICENSE
Encoding: UTF-8
-LazyData: true
Roxygen: list(markdown = TRUE)
-RoxygenNote: 7.1.2
+RoxygenNote: 7.3.1
Suggests:
covr,
XML,
@@ -48,14 +47,14 @@ Suggests:
bookdown,
here,
xml2,
- rvest
+ rvest,
+ fs
Imports:
desc,
devtools,
R6,
roxygen2,
lubridate,
- fs,
rlang,
yaml,
whoami,
@@ -69,7 +68,8 @@ Imports:
knitr,
kableExtra,
testthat,
- tidyselect
+ tidyselect,
+ rstudioapi
VignetteBuilder: knitr
SystemRequirements:
lua
diff --git a/man/val_init.Rd b/man/val_init.Rd
index b3422fe..6c113c4 100644
--- a/man/val_init.Rd
+++ b/man/val_init.Rd
@@ -35,10 +35,10 @@ vt_create_packet(
\item{fields}{A named list of fields to add to \code{DESCRIPTION}, potentially
overriding default values. See \code{\link[usethis:use_description]{use_description()}} for how you can set
-personalized defaults using package options}
+personalized defaults using package options.}
\item{rstudio}{If \code{TRUE}, calls \code{\link[usethis:use_rstudio]{use_rstudio()}} to make the new package or
-project into an \href{https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects}{RStudio Project}.
+project into an \href{https://r-pkgs.org/workflow101.html#sec-workflow101-rstudio-projects}{RStudio Project}.
If \code{FALSE} and a non-package project, a sentinel \code{.here} file is placed so
that the directory can be recognized as a project by the
\href{https://here.r-lib.org}{here} or
@@ -47,11 +47,11 @@ that the directory can be recognized as a project by the
\item{roxygen}{Do you plan to use roxygen2 to document your package?}
\item{check_name}{Whether to check if the name is valid for CRAN and throw an
-error if not}
+error if not.}
\item{open}{If \code{TRUE}, \link[usethis:proj_activate]{activates} the new project:
\itemize{
-\item If RStudio desktop, the package is opened in a new session.
+\item If using RStudio desktop, the package is opened in a new session.
\item If on RStudio server, the current RStudio project is activated.
\item Otherwise, the working directory and active project is changed.
}}
diff --git a/man/vt_dynamic_referencer.Rd b/man/vt_dynamic_referencer.Rd
index 07a1fe7..15d3192 100644
--- a/man/vt_dynamic_referencer.Rd
+++ b/man/vt_dynamic_referencer.Rd
@@ -74,16 +74,16 @@ ref$list_references()
\section{Methods}{
\subsection{Public methods}{
\itemize{
-\item \href{#method-scrape_references}{\code{vt_dynamic_referencer$scrape_references()}}
-\item \href{#method-reference_insertion}{\code{vt_dynamic_referencer$reference_insertion()}}
-\item \href{#method-list_references}{\code{vt_dynamic_referencer$list_references()}}
-\item \href{#method-new}{\code{vt_dynamic_referencer$new()}}
-\item \href{#method-clone}{\code{vt_dynamic_referencer$clone()}}
+\item \href{#method-vt_dynamic_referencer-scrape_references}{\code{vt_dynamic_referencer$scrape_references()}}
+\item \href{#method-vt_dynamic_referencer-reference_insertion}{\code{vt_dynamic_referencer$reference_insertion()}}
+\item \href{#method-vt_dynamic_referencer-list_references}{\code{vt_dynamic_referencer$list_references()}}
+\item \href{#method-vt_dynamic_referencer-new}{\code{vt_dynamic_referencer$new()}}
+\item \href{#method-vt_dynamic_referencer-clone}{\code{vt_dynamic_referencer$clone()}}
}
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-scrape_references}{}}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-vt_dynamic_referencer-scrape_references}{}}}
\subsection{Method \code{scrape_references()}}{
collect references from text.
\subsection{Usage}{
@@ -113,8 +113,8 @@ ref$list_references()
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-reference_insertion}{}}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-vt_dynamic_referencer-reference_insertion}{}}}
\subsection{Method \code{reference_insertion()}}{
replace references in text with values
\subsection{Usage}{
@@ -142,8 +142,8 @@ ref$reference_insertion("This is my ##new_reference")
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-list_references}{}}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-vt_dynamic_referencer-list_references}{}}}
\subsection{Method \code{list_references()}}{
list references available and their value
\subsection{Usage}{
@@ -163,8 +163,8 @@ ref$list_references()
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-new}{}}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-vt_dynamic_referencer-new}{}}}
\subsection{Method \code{new()}}{
create a new dynamic reference object
\subsection{Usage}{
@@ -188,8 +188,8 @@ a new \code{vt_dynamic_reference} object
}
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-clone}{}}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-vt_dynamic_referencer-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R
new file mode 100644
index 0000000..a57221e
--- /dev/null
+++ b/tests/testthat/helper.R
@@ -0,0 +1,10 @@
+#' Create vt test package silently and non-interactively
+make_vt_test_package <- function(){
+ withr::with_options(
+ list(
+ usethis.quiet = TRUE
+ ),
+ {
+ vt_create_package(rstudio = FALSE, open = FALSE)
+ })
+}
diff --git a/tests/testthat/test-add_file.R b/tests/testthat/test-add_file.R
index c1d6bc1..01e437f 100644
--- a/tests/testthat/test-add_file.R
+++ b/tests/testthat/test-add_file.R
@@ -1,8 +1,8 @@
test_that("validation file path finds files within the validation infrastructure, throws error otherwise", {
withr::with_tempdir({
- vt_use_validation()
- vt_use_req("example_req.md",username = "sample")
+ make_vt_test_package()
+ vt_use_req("example_req.md", username = "sample", open = FALSE)
fp <- validation_file_path(
file = "example_req.md",
diff --git a/tests/testthat/test-change_log_handlers.R b/tests/testthat/test-change_log_handlers.R
index 1dd5205..c60bf83 100644
--- a/tests/testthat/test-change_log_handlers.R
+++ b/tests/testthat/test-change_log_handlers.R
@@ -1,10 +1,8 @@
test_that("create change log from template", {
withr::with_tempdir({
- captured_output <- capture.output(vt_create_package("myTestPkg", open = FALSE))
- setwd("myTestPkg")
-
- vt_use_change_log(date = "2021-01-01")
+ make_vt_test_package()
+ vt_use_change_log(date = "2021-01-01", open = FALSE)
expect_true(file.exists("vignettes/validation/change_log.md"))
expect_equal(readLines("vignettes/validation/change_log.md")[1],
@@ -13,9 +11,8 @@ test_that("create change log from template", {
})
withr::with_tempdir({
- captured_output <- capture.output(vt_create_package("myTestPkg", open = FALSE))
- setwd("myTestPkg")
- vt_use_change_log()
+ make_vt_test_package()
+ vt_use_change_log(open = FALSE)
expect_true(file.exists("vignettes/validation/change_log.md"))
expect_equal(readLines("vignettes/validation/change_log.md")[1],
paste("# 0.0.0.9000",format(Sys.Date(), "%Y-%m-%d")))
@@ -27,10 +24,9 @@ test_that("change log not in a package", {
withr::with_tempdir({
- file.create(".here")
- vt_use_validation()
+ make_vt_test_package()
- vt_use_change_log(date = "2021-01-01", version = "0.0.0.9000")
+ vt_use_change_log(date = "2021-01-01", version = "0.0.0.9000", open = FALSE)
expect_equal(
vt_scrape_change_log(),
@@ -43,10 +39,8 @@ test_that("change log not in a package", {
withr::with_tempdir({
- file.create(".here")
- vt_use_validation()
-
- vt_use_change_log()
+ make_vt_test_package()
+ vt_use_change_log(open = FALSE, version = "1.0")
expect_equal(
vt_scrape_change_log(),
data.frame(version = "1.0",
@@ -62,8 +56,7 @@ test_that("Throw informative error when change log does not exist", {
withr::with_tempdir({
- file.create(".here")
- vt_use_validation()
+ make_vt_test_package()
expect_error(
vt_scrape_change_log(),
diff --git a/tests/testthat/test-child_files.R b/tests/testthat/test-child_files.R
index 9f5cc91..dcdfa78 100644
--- a/tests/testthat/test-child_files.R
+++ b/tests/testthat/test-child_files.R
@@ -1,6 +1,6 @@
test_that("child files in pkg", {
withr::with_tempdir({
- capture_output <- capture.output({vt_create_package(open = FALSE)})
+ make_vt_test_package()
vt_use_req("req1", username = "a user", open = FALSE)
vt_use_test_case("testcase1", username = "a user", open = FALSE)
@@ -42,7 +42,7 @@ test_that("child files in pkg", {
test_that("child files outside pkg", {
withr::with_tempdir({
- vt_use_validation()
+ make_vt_test_package()
vt_use_test_case("testcase1", username = "a user", open = FALSE)
vt_use_req("req1", username = "a user", open = FALSE)
vt_use_test_code("testcode1", username = "another user", open = FALSE)
@@ -63,7 +63,7 @@ test_that("child files outside pkg", {
test_that("incomplete set", {
withr::with_tempdir({
- vt_use_validation()
+ make_vt_test_package()
vt_use_test_case("testcase1", username = "a user", open = FALSE)
vt_use_test_case("testcase2", username = "a user", open = FALSE)
vt_use_req("req1", username = "a user", open = FALSE)
@@ -87,7 +87,7 @@ test_that("incomplete set", {
test_that("compatibility between vt_get_child_files and vt_files", {
withr::with_tempdir({
- captured_output <- capture.output({vt_create_package(open = FALSE)})
+ make_vt_test_package()
vt_use_test_case("testcase1", username = "a user", open = FALSE)
vt_use_test_case("testcase2", username = "a user", open = FALSE)
vt_use_req("req1", username = "a user", open = FALSE)
@@ -97,11 +97,12 @@ test_that("compatibility between vt_get_child_files and vt_files", {
setwd(file.path("vignettes", "validation"))
knitr::opts_knit$set("output.dir"= ".")
+
rmd_asis <- capture.output({vt_file(child_files)})
- testthat::expect_equal(rmd_asis[9],
- "+ Setup: DOCUMENT ANY SETUP THAT NEEDS TO BE DONE FOR TESTING")
+ testthat::expect_in("+ Setup: DOCUMENT ANY SETUP THAT NEEDS TO BE DONE FOR TESTING",
+ rmd_asis)
- suppressWarnings(testthat::expect_error(vt_file(basename(child_files))))
+ testthat::expect_error(suppressWarnings(vt_file(basename(child_files))))
})
})
diff --git a/tests/testthat/test-create_item.R b/tests/testthat/test-create_item.R
index 6e3121e..4a54361 100644
--- a/tests/testthat/test-create_item.R
+++ b/tests/testthat/test-create_item.R
@@ -68,7 +68,7 @@ test_that("vt_use_ family works nicely with simple item creation", {
withr::with_tempdir({
# set up validation infrastructure
- vt_use_validation()
+ make_vt_test_package()
## create items
spec_path <- create_item(
@@ -84,13 +84,13 @@ test_that("vt_use_ family works nicely with simple item creation", {
type = "test_code")
expect_true(
- file.exists("validation/requirements/new_dir/new_specification")
+ file.exists("vignettes/validation/requirements/new_dir/new_specification")
)
expect_true(
- file.exists("validation/test_cases/new_dir/new_test_case")
+ file.exists("vignettes/validation/test_cases/new_dir/new_test_case")
)
expect_true(
- file.exists("validation/test_code/new_dir/new_test_code")
+ file.exists("vignettes/validation/test_code/new_dir/new_test_code")
)
})
diff --git a/tests/testthat/test-evaluate_test_code.R b/tests/testthat/test-evaluate_test_code.R
index b579e96..a136a67 100644
--- a/tests/testthat/test-evaluate_test_code.R
+++ b/tests/testthat/test-evaluate_test_code.R
@@ -375,29 +375,24 @@ test_that("vt_kable_test_code_results returns formatted kable object",{
),position = "center"), latex_options = "hold_position")
)
- output_empty <- vt_kable_test_code_results(data.frame(
+ output_empty_df <- data.frame(
Test = character(),
Results = character(),
Pass_Fail = character(),
stringsAsFactors = FALSE
- ))
-
- expect_equal(
- output_empty,
- kable_styling(
- kable_styling(
- kable(
- data.frame(
- Test = character(),
- Results = character(),
- Pass_Fail = character(),
- stringsAsFactors = FALSE
- ),
- escape = FALSE,
- col.names = c("Test", "Results", "Pass/Fail")
- ),position = "center"), latex_options = "hold_position")
)
+ output_empty <- vt_kable_test_code_results(output_empty_df)
+
+ output_empty_df2 <- output_empty_df
+ names(output_empty_df2) <- c('Test', 'Results', 'Pass/Fail')
+ output_empty2 <- output_empty_df2 %>%
+ kable(format = 'html') %>%
+ kable_styling(position = "center") %>%
+ kable_styling(latex_options = "hold_position")
+
+ expect_equal(output_empty, output_empty2)
+
skip_on_cran()
withr::with_tempfile(
diff --git a/tests/testthat/test-lua_dynamic_referencing.R b/tests/testthat/test-lua_dynamic_referencing.R
index d8f6b3f..1a217bc 100644
--- a/tests/testthat/test-lua_dynamic_referencing.R
+++ b/tests/testthat/test-lua_dynamic_referencing.R
@@ -114,7 +114,7 @@ test_that("lua numbering for html", {
pattern = "Later\\sreference\\sto\\s\\((\\d)\\)\\s-\\s(\\d)",
replacement = "\\1")))
expect_equal(c(1, 1, 2, 2, 1, 3, 2),
- as.numeric(unlist(lapply(strsplit(list_rendered, ": "), FUN = function(x){x[2]}))))
+ as.integer(sub(".*(\\d{1})$", "\\1", list_rendered)))
})
diff --git a/tests/testthat/test-scrape_authors.R b/tests/testthat/test-scrape_authors.R
index 020b9da..225bbd3 100644
--- a/tests/testthat/test-scrape_authors.R
+++ b/tests/testthat/test-scrape_authors.R
@@ -3,31 +3,17 @@ test_that("Scrape roxygen tags from reqs works", {
withr::with_tempdir({
## test setup
- vt_use_validation(
- username_list = list(
- vt_user(
- username = "user1",
- name = "Test User",
- role = "sample",
- title = "Req Writer"
- ),
- vt_user(
- username = "user2",
- name = "Test User 2",
- role = "sample",
- title = "Req Writer"
- )
- ))
+ make_vt_test_package()
- vt_use_req("req001.md",username = "Test User")
- vt_use_req("req002.md",username = "Test User")
- vt_use_req("req003.md",username = "Test User 2")
+ vt_use_req("req001.md",username = "Test User", open = FALSE)
+ vt_use_req("req002.md",username = "Test User", open = FALSE)
+ vt_use_req("req003.md",username = "Test User 2", open = FALSE)
## scrape
tag_list <- vt_scrape_tags_from(
type = "requirements",
tags = c("editor","editDate"),
- ref = "validation")
+ ref = file.path("vignettes", "validation"))
## check values
@@ -62,31 +48,17 @@ test_that("Scrape roxygen tags from test cases works", {
withr::with_tempdir({
## test setup
- vt_use_validation(
- username_list = list(
- vt_user(
- username = "user1",
- name = "Test User",
- role = "sample",
- title = "Req Writer"
- ),
- vt_user(
- username = "user2",
- name = "Test User 2",
- role = "sample",
- title = "Req Writer"
- )
- ))
+ make_vt_test_package()
- vt_use_test_case("test_case_001.md",username = "Test User")
- vt_use_test_case("test_case_002.md",username = "Test User")
- vt_use_test_case("test_case_003.md",username = "Test User 2")
+ vt_use_test_case("test_case_001.md",username = "Test User", open = FALSE)
+ vt_use_test_case("test_case_002.md",username = "Test User", open = FALSE)
+ vt_use_test_case("test_case_003.md",username = "Test User 2", open = FALSE)
## scrape
tag_list <- vt_scrape_tags_from(
type = "test_cases",
tags = c("editor","editDate"),
- ref = "validation")
+ ref = file.path("vignettes", "validation"))
## check values
@@ -121,51 +93,25 @@ test_that("Scrape roxygen tags from test code works", {
withr::with_tempdir({
## test setup
- vt_use_validation(
- username_list = list(
- vt_user(
- username = "user1",
- name = "Test User",
- role = "sample",
- title = "Req Writer"
- ),
- vt_user(
- username = "user2",
- name = "Test User 2",
- role = "sample",
- title = "Req Writer"
- ),
- vt_user(
- username = "user3",
- name = "Test User 3",
- role = "sample",
- title = "Test Code Writer"
- ),
- vt_user(
- username = "user4",
- name = "Test User 4",
- role = "sample",
- title = "Test Code Writer"
- )
- ))
+ make_vt_test_package()
vt_use_test_code("test_code_001",username = "Test User 3")
- text <- readLines("validation/test_code/test_code_001.R")
- writeLines(gsub("TESTNUMBER","1.1", text),"validation/test_code/test_code_001.R")
+ text <- readLines("vignettes/validation/test_code/test_code_001.R")
+ writeLines(gsub("TESTNUMBER","1.1", text),"vignettes/validation/test_code/test_code_001.R")
vt_use_test_code("test_code_002",username = "Test User 4")
- text <- readLines("validation/test_code/test_code_002.R")
- writeLines(gsub("TESTNUMBER","2.1", text),"validation/test_code/test_code_002.R")
+ text <- readLines("vignettes/validation/test_code/test_code_002.R")
+ writeLines(gsub("TESTNUMBER","2.1", text),"vignettes/validation/test_code/test_code_002.R")
vt_use_test_code("test_code_003",username = "Test User 4")
- text <- readLines("validation/test_code/test_code_003.R")
- writeLines(gsub("TESTNUMBER","3.1", text),"validation/test_code/test_code_003.R")
+ text <- readLines("vignettes/validation/test_code/test_code_003.R")
+ writeLines(gsub("TESTNUMBER","3.1", text),"vignettes/validation/test_code/test_code_003.R")
## scrape
tag_list <- vt_scrape_tags_from(
type = "test_code",
tags = c("editor","editDate"),
- ref = "validation")
+ ref = file.path("vignettes", "validation"))
## check values
expect_equal(
@@ -198,13 +144,9 @@ test_that("scrape functions from external dir", {
withr::with_tempdir({
- capture_output <- capture.output({
- usethis::create_package(path = "example.package" , open = FALSE,rstudio = TRUE)
- })
-
- vt_use_validation()
+ make_vt_test_package()
- this_file1 <- file.path("example.package", "R/hello_world.R")
+ this_file1 <- file.path("R", "hello_world.R")
fs::file_create(path = this_file1)
cat(file = this_file1, append = FALSE,c(
"#' @title Hello World!",
@@ -222,7 +164,7 @@ test_that("scrape functions from external dir", {
# ignores extra spaces
# accommodates minor variation in date format
# accommodates minor variation in formatting of last update date
- this_file2 <- file.path("example.package", "R/second_func.R")
+ this_file2 <- file.path("R", "second_func.R")
fs::file_create(path = this_file2)
cat(
file = this_file2,
@@ -257,7 +199,7 @@ test_that("scrape functions from external dir", {
# pulls function authorship from roxygen2 block, even if no function included
# ignores stray comments
- this_file3 <- file.path("example.package", "R/null_doc.R")
+ this_file3 <- file.path("R", "null_doc.R")
fs::file_create(path = this_file3)
cat(file = this_file3, append = FALSE,c(
"#' @title Fourth_Function",
@@ -286,7 +228,7 @@ test_that("scrape functions from external dir", {
tag_list <- vt_scrape_tags_from(
type = "functions",
tags = c("editor", "editDate"),
- src = "example.package",
+ src = ".",
ref = "vignettes/validation"
)
})
@@ -331,21 +273,7 @@ test_that("Scrape roxygen tags and specific tags are missing throws warnings", {
withr::with_tempdir({
## test setup
- vt_use_validation(
- username_list = list(
- vt_user(
- username = "user1",
- name = "Test User",
- role = "sample",
- title = "Req Writer"
- ),
- vt_user(
- username = "user2",
- name = "Test User 2",
- role = "sample",
- title = "Req Writer"
- )
- ))
+ make_vt_test_package()
vt_use_test_case("test_case_001.md",username = "Test User")
@@ -354,7 +282,7 @@ test_that("Scrape roxygen tags and specific tags are missing throws warnings", {
tag_list <- vt_scrape_tags_from(
type = "test_cases",
tags = c("fake_tag"),
- ref = "validation")
+ ref = file.path("vignettes", "validation"))
})
diff --git a/tests/testthat/test-validate_sequence.R b/tests/testthat/test-validate_sequence.R
index 7d30e38..def5bd5 100644
--- a/tests/testthat/test-validate_sequence.R
+++ b/tests/testthat/test-validate_sequence.R
@@ -3,19 +3,11 @@ test_that("test running validation.Rmd from source", {
withr::with_tempdir({
## create blank package
- quiet <- capture.output({
- usethis::create_package("example.package")
- })
-
- setwd("example.package")
-
- ## make vignette and validation dir
- dir.create("vignettes")
- dir.create("vignettes/validation")
+ make_vt_test_package()
## create config file
writeLines(text = c(
- "package: example.package",
+ paste0('package: ', basename(getwd())),
"working_dir: vignettes",
"output_dir: inst",
"report_rmd_name: validation.Rmd",
@@ -54,7 +46,7 @@ test_that("test running validation.Rmd from source", {
normalizePath(validation_report_output,winslash = "/"),
normalizePath(file.path(
getwd(),
- paste0("inst/validation/Validation_Report_example.package_v0.0.0.9000_",format(Sys.Date(),"%Y%m%d.pdf"))),
+ paste0("inst/validation/Validation_Report_", basename(getwd()), "_v0.0.0.9000_",format(Sys.Date(),"%Y%m%d.pdf"))),
winslash = "/")
)
diff --git a/tests/testthat/test-validation_config.R b/tests/testthat/test-validation_config.R
index 4d588b0..ba1d0d7 100644
--- a/tests/testthat/test-validation_config.R
+++ b/tests/testthat/test-validation_config.R
@@ -110,7 +110,7 @@ test_that("Test creation of the config file without passed values in a non-inter
expect_equal(
add_user_message,
- "User `test` added to validation config file.\n",
+ "User `test` added to validation config file.",
)
expect_equal(
@@ -137,7 +137,7 @@ test_that("Test creation of the config file without passed values in a non-inter
expect_equal(
add_user_message2,
- "User `test2` added to validation config file.\n",
+ "User `test2` added to validation config file.",
)
expect_equal(
@@ -212,7 +212,7 @@ test_that("Test creation of the config file without passed values in a non-inter
expect_equal(
add_user_message,
- "User `test` information updated in the validation config file.\n",
+ "User `test` information updated in the validation config file.",
)
expect_equal(
diff --git a/tests/testthat/test-vt_file.R b/tests/testthat/test-vt_file.R
index ed3b559..84e47c0 100644
--- a/tests/testthat/test-vt_file.R
+++ b/tests/testthat/test-vt_file.R
@@ -445,7 +445,7 @@ test_that("evaluating default files works", {
test_that("rendered report is as expected using vt_file", {
withr::with_tempdir({
- vt_use_validation()
+ make_vt_test_package()
vt_use_req("example_req.md",username = "sample")
vt_use_test_case("example_test_case.md",username = "sample")
@@ -514,7 +514,7 @@ test_that("rendered report is as expected using vt_file", {
test_that("rendered report works using file.path inside vt_file", {
withr::with_tempdir({
- vt_use_validation()
+ make_vt_test_package()
vt_use_req("example_req.md",username = "sample")
vt_use_test_case("example_test_case.md",username = "sample")
@@ -537,15 +537,15 @@ test_that("rendered report works using file.path inside vt_file", {
"---",
"",
"```{r rando-file, echo = FALSE, results = 'asis'}",
- "vt_file(file=file.path(\"validation\",\"rando_file.Rmd\"))",
+ "vt_file(file=file.path(\"vignettes\",\"validation\",\"rando_file.Rmd\"))",
"```",
"",
"```{r example-req, echo = FALSE, results = 'asis'}",
- "vt_file(file=file.path(\"validation\",\"requirements\",\"example_req.md\"))",
+ "vt_file(file=file.path(\"vignettes\",\"validation\",\"requirements\",\"example_req.md\"))",
"```",
"",
"```{r example-test-case, echo = FALSE, results = 'asis'}",
- "vt_file(file=file.path(\"validation\",\"test_cases\",\"example_test_case.md\"))",
+ "vt_file(file=file.path(\"vignettes\",\"validation\",\"test_cases\",\"example_test_case.md\"))",
"```"
), con = "report.Rmd"
)
@@ -583,7 +583,7 @@ test_that("rendered report works using file.path inside vt_file", {
test_that("rendered report works using file.path inside vt_file - vectorized", {
withr::with_tempdir({
- vt_use_validation()
+ make_vt_test_package()
vt_use_req("example_req.md",username = "sample")
vt_use_test_case("example_test_case.md",username = "sample")
vt_use_test_code("example_test_code.r",username = "sample")
diff --git a/tests/testthat/test-vt_path.R b/tests/testthat/test-vt_path.R
index ac2138c..985fbaa 100644
--- a/tests/testthat/test-vt_path.R
+++ b/tests/testthat/test-vt_path.R
@@ -2,11 +2,11 @@ test_that("vt_path returns expected path", {
withr::with_tempdir({
## setup
- vt_use_validation()
- actual_dir <- file.path(getwd(),"validation")
+ make_vt_test_package()
+ actual_dir <- file.path(getwd(), "vignettes", "validation")
path_check <- vt_path()
- setwd("validation/")
+ setwd(file.path("vignettes", "validation"))
path_check2 <- vt_path()