Accessing files in inst during testing

I have a bunch of template Rmd files in a package:

inst/templates/t1.Rmd
inst/templates/t2.Rmd
# etc

To access them I would normally do

system.file("templates", "t1.Rmd", package = "Z", mustWork = TRUE)

However, when I want to access the files for testing, the file can't be found

  • It can be found running devtools::test()
  • But not using R CMD check

How do I access the file in a testthat framework?


I presume this devtools shim should solve the problem, but I can't get it to work.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.