In most litr tests, we call render() on a template .Rmd file. However, if we have used rmarkdown::draft([...], package="litr"), the file retrieved will be from an old version of the package (namely the installed version of litr's template) rather than the latest version. Furthermore, this template .Rmd file has calls to litr::setup() and litr::document(). When these are called in the knitting process, it will be the versions of the functions from the currently installed litr rather than the versions that we are trying to test. In short, I don't think the current tests are testing the right thing!
There are multiple approaches to addressing this, but I think the most straightforward will be to use eval=FALSE in those testing code chunks (i.e., don't test along the way). Instead, at the end of create-litr.Rmd, we can install the new version and then run devtools::test(). At the end of this process we should reinstall the previous version of litr so that we don't get confused and start using a more recent version of litr as we make changes to create-litr.Rmd.
In most
litr
tests, we callrender()
on a template .Rmd file. However, if we have usedrmarkdown::draft([...], package="litr")
, the file retrieved will be from an old version of the package (namely the installed version oflitr
's template) rather than the latest version. Furthermore, this template .Rmd file has calls tolitr::setup()
andlitr::document()
. When these are called in the knitting process, it will be the versions of the functions from the currently installedlitr
rather than the versions that we are trying to test. In short, I don't think the current tests are testing the right thing!There are multiple approaches to addressing this, but I think the most straightforward will be to use
eval=FALSE
in those testing code chunks (i.e., don't test along the way). Instead, at the end ofcreate-litr.Rmd
, we can install the new version and then rundevtools::test()
. At the end of this process we should reinstall the previous version oflitr
so that we don't get confused and start using a more recent version oflitr
as we make changes tocreate-litr.Rmd
.