From 6e57aa3b1b7d5061d45f0403c94fc135eafd56ef Mon Sep 17 00:00:00 2001 From: Daniel Sjoberg Date: Tue, 23 Jan 2024 14:46:58 -0800 Subject: [PATCH] snap updates --- tests/testthat/_snaps/ard_proportion_ci.md | 6 ++-- tests/testthat/test-ard_proportion_ci.R | 32 +++++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/testthat/_snaps/ard_proportion_ci.md b/tests/testthat/_snaps/ard_proportion_ci.md index 1737d7ab8..757e4b37a 100644 --- a/tests/testthat/_snaps/ard_proportion_ci.md +++ b/tests/testthat/_snaps/ard_proportion_ci.md @@ -1,8 +1,7 @@ # ard_proportion_ci(method='strat_wilson') works Code - ard_proportion_ci(data = data.frame(rsp = rsp, strata = interaction(strata_data)), - variables = rsp, strata = strata, weights = weights, method = "strat_wilson") + ard_proportion_ci_strat_wilson Message {cards} data frame: 1 x 8 Output @@ -14,8 +13,7 @@ --- Code - ard_proportion_ci(data = data.frame(rsp = rsp, strata = interaction(strata_data)), - variables = rsp, strata = strata, weights = weights, method = "strat_wilsoncc") + ard_proportion_ci_strat_wilsoncc Message {cards} data frame: 1 x 8 Output diff --git a/tests/testthat/test-ard_proportion_ci.R b/tests/testthat/test-ard_proportion_ci.R index f51499550..0aacc3ab7 100644 --- a/tests/testthat/test-ard_proportion_ci.R +++ b/tests/testthat/test-ard_proportion_ci.R @@ -33,8 +33,9 @@ test_that("ard_proportion_ci(method='strat_wilson') works", { weights <- 1:6 / sum(1:6) - expect_snapshot( - ard_proportion_ci( + expect_error( + ard_proportion_ci_strat_wilson <- + ard_proportion_ci( data = data.frame( rsp = rsp, strata = interaction(strata_data) @@ -43,19 +44,24 @@ test_that("ard_proportion_ci(method='strat_wilson') works", { strata = strata, weights = weights, method = "strat_wilson" - ) + ), + NA ) + expect_snapshot(ard_proportion_ci_strat_wilson) - expect_snapshot( - ard_proportion_ci( - data = data.frame( - rsp = rsp, - strata = interaction(strata_data) + expect_error( + ard_proportion_ci_strat_wilsoncc <- + ard_proportion_ci( + data = data.frame( + rsp = rsp, + strata = interaction(strata_data) + ), + variables = rsp, + strata = strata, + weights = weights, + method = "strat_wilsoncc" ), - variables = rsp, - strata = strata, - weights = weights, - method = "strat_wilsoncc" - ) + NA ) + expect_snapshot(ard_proportion_ci_strat_wilsoncc) })