One of my functions check if the README.Rmd is build when it exists. I test my function via a unit test. When I run the unit test interactively if works as expected. When I run devtools::test() it fails with Can't find a 'README.Rmd' or 'inst/README.Rmd' file. (the related line in the devtools code).
I'm puzzled why this should happen as my code only runs build_readme() when the README.Rmd exists.
if (file_test("-f", file.path(x$get_path, "README.Rmd"))) {
status_before <- status(repo)
build_readme(x$get_path, encoding = "UTF-8")
doc_error <- c(
doc_error,
"`README.Rmd` need to be rendered. Run `devtools::build_readme()`"[
!unchanged_repo(repo, status_before)
]
)
}
One of my functions check if the README.Rmd is build when it exists. I test my function via a unit test. When I run the unit test interactively if works as expected. When I run
devtools::test()it fails withCan't find a 'README.Rmd' or 'inst/README.Rmd' file.(the related line in the devtools code).I'm puzzled why this should happen as my code only runs
build_readme()when theREADME.Rmdexists.