-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will address carpentries/workbench#65 by adding fallbacks to the episodes directory criteria. I've added the other directories we expect so that when the episodes directory does not exist (in the case of overview pages), then we can check that the site directory or any of the other directories exists. I had initially attempted this by setting the config.yaml as the criteria, but I forgot that I had also copied the config.yaml over to the site/built folder, so there were a lot of failures from this one change because it was getting confused where the root of the project. Another tactic I considered was to check if `.git/` was a directory, but then I realized this wouldn't work for submodules.
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
res <- restore_fixture() | ||
|
||
|
||
test_that("root path will find the root of the lesson locally", { | ||
|
||
here <- as.character(res) | ||
expect_identical(root_path(here), here) | ||
|
||
there <- fs::path(res, "episodes") | ||
expect_identical(root_path(there), here) | ||
|
||
there <- fs::path(res, "learners", "setup.md") | ||
expect_identical(root_path(there), here) | ||
|
||
# if we insert a config.yaml file into the built folder, it will not cause a | ||
# problem | ||
there <- fs::path(res, "site", "built") | ||
fs::file_copy(fs::path(res, "config.yaml"), there) | ||
expect_identical(root_path(there), here) | ||
|
||
# removing the episodes folder does not invalidate the lesson | ||
fs::dir_delete(fs::path(here, "episodes")) | ||
expect_identical(root_path(there), here) | ||
|
||
}) | ||
|