Skip to content

Commit 2c1005e

Browse files
committed
Remove dontrun{} examples
1 parent dde3491 commit 2c1005e

File tree

5 files changed

+58
-38
lines changed

5 files changed

+58
-38
lines changed

R/cases.R

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
#' Collect and validate cases
1+
#' Collect cases
22
#'
33
#' These functions are mainly intended for internal use by
44
#' \code{\link{manage_cases}()}. They are useful to programmatically
5-
#' collect and validate cases.
5+
#' collect cases.
66
#'
77
#' @inheritParams manage_cases
8-
#' @param cases A \code{cases} object returned by one of the
9-
#' collecting functions.
108
#' @seealso \code{\link{manage_cases}()}
9+
#' @return A \code{cases} object. \code{collect_new_cases()},
10+
#' \code{collect_mismatched_cases()} and
11+
#' \code{collect_orphaned_cases()} return a filtered \code{cases}
12+
#' object.
1113
#' @export
12-
#' @examples
13-
#' \dontrun{
14-
#' new_cases <- collect_new_cases()
15-
#' validate_cases(new_cases)
16-
#' delete_orphaned_cases()
17-
#' }
1814
collect_cases <- function(package = ".", filter = NULL) {
1915
on.exit(set_active_collecter(NULL))
2016

@@ -82,7 +78,15 @@ collect_orphaned_cases <- function(package = ".") {
8278
filter_cases(collect_cases(package), "case_orphaned")
8379
}
8480

85-
#' @rdname collect_cases
81+
#' Cases validation
82+
#'
83+
#' These functions are mainly intended for internal use by
84+
#' \code{\link{manage_cases}()}. They are useful to programmatically
85+
#' validate cases or delete orphaned cases.
86+
#'
87+
#' @seealso \code{\link{manage_cases}()}
88+
#' @param cases A \code{cases} object returned by one of the
89+
#' collecting functions such as \code{\link{collect_cases}()}.
8690
#' @export
8791
validate_cases <- function(cases = collect_new_cases()) {
8892
stopifnot(is_cases(cases))
@@ -112,7 +116,7 @@ update_case <- function(case, pkg_path) {
112116
file.copy(case$testcase, path, overwrite = TRUE)
113117
}
114118

115-
#' @rdname collect_cases
119+
#' @rdname validate_cases
116120
#' @export
117121
delete_orphaned_cases <- function(cases = collect_orphaned_cases()) {
118122
stopifnot(is_cases(cases))

R/testthat-ui.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
#' standard families and Symbola font for symbols.
2929
#' @export
3030
#' @examples
31-
#' \dontrun{
3231
#' disp_hist_base <- function() hist(mtcars$disp)
33-
#' disp_hist_ggplot <- ggplot(mtcars, aes(disp)) + geom_histogram()
32+
#' expect_doppelganger("disp-histogram-base", disp_hist_base)
3433
#'
35-
#' expect_doppelganger(disp_hist_base, "disp-histogram-base")
36-
#' expect_doppelganger(disp_hist_ggplot, "disp-histogram-ggplot")
34+
#' if (requireNamespace("ggplot2", quietly = TRUE)) {
35+
#' library("ggplot2")
36+
#' disp_hist_ggplot <- ggplot(mtcars, aes(disp)) + geom_histogram()
37+
#' expect_doppelganger("disp-histogram-ggplot", disp_hist_ggplot)
3738
#' }
3839
expect_doppelganger <- function(title, fig, path = NULL, ...,
3940
user_fonts = NULL) {

man/collect_cases.Rd

Lines changed: 8 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/expect_doppelganger.Rd

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/validate_cases.Rd

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)