Skip to content

Commit

Permalink
Fencing off examples/tests when broom.helpers not available
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Sep 23, 2024
1 parent 148787b commit 3825987
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions R/ard_aod_wald_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
#' @return data frame
#' @export
#'
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "aod", reference_pkg = "cardx"))
#' @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", "broom.helpers"), reference_pkg = "cardx"))
#' lm(AGE ~ ARM, data = cards::ADSL) |>
#' ard_aod_wald_test()
ard_aod_wald_test <- function(x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ...) {
set_cli_abort_call()
check_pkg_installed("broom.helpers", reference_pkg = "cardx")

# check installed packages ---------------------------------------------------
check_pkg_installed("aod", reference_pkg = "cardx")
check_pkg_installed(c("aod", "broom.helpers"), reference_pkg = "cardx")

# check inputs ---------------------------------------------------------------
check_not_missing(x)
Expand Down
2 changes: 1 addition & 1 deletion man/ard_aod_wald_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-ard_aod_wald_test.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
skip_if_not(do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "aod", reference_pkg = "cardx")))
skip_if_not(do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", "broom.helpers"), reference_pkg = "cardx")))

test_that("ard_aod_wald_test() works", {
# works for a generic case
Expand Down

0 comments on commit 3825987

Please sign in to comment.