-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
richelbilderbeek
committed
Jun 13, 2022
1 parent
7d39a6c
commit 7bc8ea1
Showing
8 changed files
with
30 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
#' Deprecated function, use \link[beautier]{create_beautier_tempfolder}. | ||
#' | ||
#' Create the default `beautier` temporary folder | ||
#' @return nothing | ||
#' @examples | ||
#' check_empty_beaustier_folders() | ||
#' | ||
#' create_beautier_tempfolder() | ||
#' | ||
#' remove_beaustier_folders() | ||
#' check_empty_beaustier_folders() | ||
#' @author Richèl J.C. Bilderbeek | ||
#' @export | ||
create_beautier_tempfolder <- function() { | ||
dir.create( | ||
dirname(beautier::get_beautier_tempfilename()), | ||
showWarnings = FALSE, | ||
recursive = TRUE | ||
stop( | ||
"'beastier::create_beautier_tempfolder' is deprecated, ", | ||
"use 'beautier::create_beautier_tempfolder' instead" | ||
) | ||
} |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#' Check there are no files in the default `beautier` folder | ||
#' Deprecated function, use \link[beautier]{remove_beautier_folder}. | ||
#' | ||
#' Deprecated function, use \link[beautier]{remove_beautier_folder}. | ||
#' | ||
#' Check there are no files in the default `beautier` folder. | ||
#' The goal is to make sure no temporary files are left undeleted. | ||
#' Will \link{stop} if there are files in the `beautier` folder. | ||
#' | ||
#' @return Nothing. | ||
#' @examples | ||
#' remove_beautier_folder() | ||
#' @author Richèl J.C. Bilderbeek | ||
#' @export | ||
remove_beautier_folder <- function() { | ||
folder_name <- beautier::get_beautier_folder() | ||
if (dir.exists(folder_name)) { | ||
unlink(folder_name, recursive = TRUE) | ||
} | ||
stop( | ||
"'beastier::remove_beautier_folder' is deprecated, ", | ||
"use 'beautier::remove_beautier_folder' instead" | ||
) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,6 @@ | ||
test_that("use", { | ||
check_empty_beaustier_folders() | ||
|
||
folder_name <- dirname(beautier::get_beautier_tempfilename()) | ||
unlink(folder_name, recursive = TRUE) | ||
expect_false(dir.exists(folder_name)) | ||
beastier::create_beautier_tempfolder() | ||
expect_true(dir.exists(folder_name)) | ||
|
||
remove_beaustier_folders() | ||
check_empty_beaustier_folders() | ||
test_that("deprecated", { | ||
expect_error( | ||
beastier::create_beautier_tempfolder(), | ||
"deprecated" | ||
) | ||
}) |
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,6 @@ | ||
test_that("deprecated", { | ||
expect_error( | ||
beastier::remove_beautier_folder(), | ||
"deprecated" | ||
) | ||
}) |