Skip to content

Commit 31908f3

Browse files
committed
add test
1 parent 35f3a67 commit 31908f3

3 files changed

Lines changed: 29 additions & 199 deletions

File tree

R/import-standalone-s3-register.R

Lines changed: 0 additions & 199 deletions
This file was deleted.

tests/testthat/_snaps/roxygen.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# @examplesVCR
2+
3+
Code
4+
out$get_section("examples")
5+
Output
6+
\examples{
7+
\dontshow{if (bla) withAutoprint(\{ # examplesIf}
8+
maybe-run-this-code
9+
\dontshow{\}) # examplesIf}
10+
\dontshow{vcr::insert_example_cassette('foobar()', package = 'vcr')}
11+
httr2::request('http://r-project.org')
12+
\dontshow{vcr::eject_cassette()}
13+
}
14+

tests/testthat/test-roxygen.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
test_that("@examplesVCR", {
2+
out <- roxygen2::roc_proc_text(
3+
roxygen2::rd_roclet(),
4+
"
5+
#' @name a
6+
#' @title a
7+
#' @examplesIf bla
8+
#' maybe-run-this-code
9+
#' @examplesVCR foobar()
10+
#' httr2::request('http://r-project.org')
11+
NULL"
12+
)[[1]]
13+
14+
expect_snapshot(out$get_section("examples"))
15+
})

0 commit comments

Comments
 (0)