-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move rmarkdown::render action to happen in a temp directory (#330)
- Loading branch information
Showing
5 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Inditended to be run last, this is to confirm that no files | ||
# within the package directory are modified during the normal | ||
# operation of pkgnet during these tests. This includes the | ||
# creation and deletion of temp files for rendering. | ||
|
||
test_that('No modification to pkgnet directory during testing',{ | ||
startModTime <- as.POSIXct(Sys.getenv('PKGNET_LATEST_MOD')) | ||
|
||
tmp_pkgnet_path <- file.path(Sys.getenv('PKGNET_TEST_LIB'), 'pkgnet') | ||
currentModTime <- file.info(tmp_pkgnet_path)$mtime | ||
|
||
if (as.character(startModTime) != as.character(currentModTime)){ | ||
pkgnet:::.printModifiedFiles(tmp_pkgnet_path, startModTime) | ||
} | ||
|
||
expect_equal(object = currentModTime | ||
, expected = startModTime | ||
, info = "The source directory was modified during the execution of tests." | ||
) | ||
|
||
}) |