Skip to content

Commit

Permalink
feat(wip): Setting sepuku
Browse files Browse the repository at this point in the history
  • Loading branch information
ymansiaux committed Jun 4, 2024
1 parent d44b650 commit 8b49fae
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions dev/flat_sepuku.Rmd
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")
```

0 comments on commit 8b49fae

Please sign in to comment.