@@ -4,6 +4,7 @@ context("MCMC: combo")
4
4
source(test_path(" data-for-mcmc-tests.R" ))
5
5
6
6
test_that(" mcmc_combo returns a gtable object" , {
7
+ skip_if_not_installed(" gridExtra" )
7
8
expect_gtable(mcmc_combo(arr , regex_pars = " beta" ))
8
9
expect_gtable(mcmc_combo(arr , regex_pars = " beta" ,
9
10
gg_theme = ggplot2 :: theme_dark()))
@@ -26,6 +27,7 @@ test_that("mcmc_combo returns a gtable object", {
26
27
27
28
# functions that require multiple chains ----------------------------------
28
29
test_that(" mcmc_combo throws error if 1 chain but multiple chains required" , {
30
+ skip_if_not_installed(" gridExtra" )
29
31
expect_error(mcmc_combo(arr1chain , regex_pars = " beta" ,
30
32
combo = c(" trace_highlight" , " dens" )),
31
33
" requires multiple chains" )
@@ -42,6 +44,7 @@ test_that("mcmc_combo throws error if 1 chain but multiple chains required", {
42
44
43
45
# other errors ------------------------------------------------------------
44
46
test_that(" mcmc_combo throws errors" , {
47
+ skip_if_not_installed(" gridExtra" )
45
48
expect_error(mcmc_combo(arr , combo = c(" trace_highlight" )),
46
49
" 'combo' should have at least two elements" )
47
50
expect_error(mcmc_combo(arr , regex_pars = " beta" ,
0 commit comments