-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
1 changed file
with
66 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: "flat_sepuku.Rmd empty" | ||
output: html_document | ||
editor_options: | ||
chunk_output_type: console | ||
--- | ||
|
||
```{r development, include=FALSE} | ||
library(testthat) | ||
``` | ||
|
||
```{r development-load} | ||
# Load already included functions if relevant | ||
pkgload::load_all(export_all = FALSE) | ||
``` | ||
|
||
# sepuku | ||
|
||
```{r function-sepuku} | ||
#' sepuku Title | ||
#' | ||
#' @return 1 | ||
#' @export | ||
#' | ||
#' @examples | ||
sepuku <- function( | ||
pkg = ".") { | ||
# Check if the package has a dev folder | ||
if (!dir.exists(file.path(pkg, "dev"))) { | ||
stop("No dev/ folder have been found. Are you sure that your package has been initiated with fusen ?") | ||
} | ||
} | ||
``` | ||
|
||
```{r examples-sepuku} | ||
sepuku() | ||
``` | ||
|
||
```{r tests-sepuku} | ||
dummypackage <- tempfile("sepuku") | ||
dir.create(dummypackage) | ||
fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package")) | ||
test_that("sepuku is a function", { | ||
expect_true(inherits(sepuku, "function")) | ||
}) | ||
usethis::with_project(dummypackage, { | ||
browser() | ||
# Add licence | ||
usethis::use_mit_license("John Doe") | ||
# Check for a dev folder | ||
expect_error( | ||
sepuku(), "No dev/ folder have been found. Are you sure that your package has been initiated with fusen ?" | ||
) | ||
}) | ||
``` | ||
|
||
|
||
```{r development-inflate, eval=FALSE} | ||
# Run but keep eval=FALSE to avoid infinite loop | ||
# Execute in the console directly | ||
fusen::inflate(flat_file = "dev/flat_sepuku.Rmd", vignette_name = "Go further") | ||
``` | ||
|