phuse-org / valtools

Validation framework for R packages used in clinical research and drug development.
https://phuse-org.github.io/valtools/
Other
51 stars 10 forks source link

vectorized `vt_file` breaks test cases in test-vt_file.R #120

Closed mariev closed 3 years ago

mariev commented 3 years ago
 withr::with_tempdir({
   writeLines(c(
     "#' @title sample title",
     "#' @editor sample editor",
     "#' @editDate 1900-01-01",
     "## Header",
     "+ Content",
     "  + more content",
     "+ Content 2"),
     con = "sample.md"
   )

  vt_file(file = "sample.md")
 })

Expectation: -vt_file will scrape the .md content

Actual:

Error: No root directory found in C:/Users/mvendett/AppData/Local/Temp/RtmpYnIa7H/file8330716d5bf9 or its parent directories. Root criterion: one of
- contains a file ".here"
- contains a file matching "[.]Rproj$" with contents matching "^Version: " in the first line
- contains a file "DESCRIPTION" with contents matching "^Package: "
- contains a directory ".git"
- contains a file ".git" with contents matching "^gitdir: "
- contains a directory ".svn" 
thebioengineer commented 3 years ago

Ah, I think this is because I added the "find_file" function into one of the child functions of vt_file - so it requires the validation infra to be there

mariev commented 3 years ago

I think both models are fine, but practically how should we be treating the failed tests?

mariev commented 3 years ago

closed via #122