From 46fc4413c3adb7bd8db346cc27fef831ea1cbfcc Mon Sep 17 00:00:00 2001 From: xec-cm Date: Wed, 17 Jan 2024 11:58:51 +0100 Subject: [PATCH] Update biocroxytest.Rmd --- vignettes/biocroxytest.Rmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vignettes/biocroxytest.Rmd b/vignettes/biocroxytest.Rmd index 9c1ce1f..e1429af 100644 --- a/vignettes/biocroxytest.Rmd +++ b/vignettes/biocroxytest.Rmd @@ -65,7 +65,7 @@ The `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` package allows you to add ex 1. **Add the `@longtests` tag to your function documentation**: In your roxygen comments for each function, you can add a `@longtests` tag followed by the tests you want to run. These tests should be written as if they were in a `testthat::test_that()` call. For example: -```{r, eval = FALSE} +```{r} #' A function to do x #' #' @param x A number @@ -86,14 +86,14 @@ In this example, the function `foo()` has two long tests associated with it: `ex For instance, if you have the `foo()` function in a file named `R/functions.R`, `roxygen2::roxygenise()` will generate a file named `longtests/test-biocroxytest-tests-functions.R` with the following content: -```{r eval = FALSE} +```{r results='hide'} # Generated by biocroxytest: do not edit by hand! # File R/functions.R: @longtests -test_that("Function foo() @ L11", { - expect_equal(foo(2), sqrt(2)) - expect_error(foo("a string")) +testthat::test_that("Function foo() @ L11", { + testthat::expect_equal(foo(2), sqrt(2)) + testthat::expect_error(foo("a string")) }) ```