diff --git a/tests/testthat/test-cronbachs_alpha.R b/tests/testthat/test-cronbachs_alpha.R index d9a584bbb..e000a1365 100644 --- a/tests/testthat/test-cronbachs_alpha.R +++ b/tests/testthat/test-cronbachs_alpha.R @@ -4,7 +4,7 @@ test_that("cronbachs_alpha, data frame", { expect_equal(cronbachs_alpha(x), 0.09463206, tolerance = 1e-3) }) test_that("cronbachs_alpha", { - expect_warning(expect_null(cronbachs_alpha(mtcars[1]))) + expect_message(expect_null(cronbachs_alpha(mtcars[1])), regex = "Too few") }) @@ -12,7 +12,7 @@ test_that("cronbachs_alpha, principal_components", { skip_if_not_installed("parameters", minimum_version = "0.21.3") pca <- parameters::principal_components(mtcars[, c("cyl", "gear", "carb", "hp")], n = 2) expect_equal(cronbachs_alpha(pca, verbose = FALSE), c(PC1 = 0.1101384), tolerance = 1e-3) - expect_warning(cronbachs_alpha(pca)) + expect_message(cronbachs_alpha(pca), regex = "Too few") pca <- parameters::principal_components(mtcars[, c("cyl", "gear", "carb", "hp")], n = 1) expect_equal(cronbachs_alpha(pca, verbose = FALSE), c(PC1 = 0.09463206), tolerance = 1e-3)