Skip to content

Commit 2e55cdf

Browse files
committed
fix
1 parent 22bd109 commit 2e55cdf

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

tests/testthat/test-display_print_dataframe.R

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
test_that("display and print method works - markdown", {
22
skip_on_cran()
3-
out <- display(correlation(iris))
4-
expect_identical(
5-
out[1:7],
6-
c(
7-
"Table: Correlation Matrix (pearson-method)",
8-
"",
9-
"|Parameter1 | Parameter2 | r | 95% CI | t(148) | p |",
10-
"|:------------|:------------:|:-----:|:--------------:|:------:|:---------:|",
11-
"|Sepal.Length | Sepal.Width | -0.12 | (-0.27, 0.04) | -1.44 | 0.152 |",
12-
"|Sepal.Length | Petal.Length | 0.87 | (0.83, 0.91) | 21.65 | < .001*** |",
13-
"|Sepal.Length | Petal.Width | 0.82 | (0.76, 0.86) | 17.30 | < .001*** |"
14-
)
15-
)
3+
skip_if_not_or_load_if_installed("knitr")
4+
expect_snapshot(display(correlation(iris)))
165
})
176

187
# display and print method works - HTML -----------------------------

tests/testthat/test-display_print_matrix.R

+2-13
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@
22

33
test_that("display and print method works - markdown", {
44
skip_on_cran()
5-
out <- capture.output(display(summary(correlation(iris))))
6-
expect_identical(
7-
out[1:7],
8-
c(
9-
"[1] \"Table: Correlation Matrix (pearson-method)\" ",
10-
"[2] \"\" ",
11-
"[3] \"|Parameter | Petal.Width | Petal.Length | Sepal.Width |\"",
12-
"[4] \"|:------------|:-----------:|:------------:|:-----------:|\"",
13-
"[5] \"|Sepal.Length | 0.82*** | 0.87*** | -0.12 |\"",
14-
"[6] \"|Sepal.Width | -0.37*** | -0.43*** | |\"",
15-
"[7] \"|Petal.Length | 0.96*** | | |\""
16-
)
17-
)
5+
skip_if_not_or_load_if_installed("knitr")
6+
expect_snapshot(display(summary(correlation(iris))))
187
})
198

209
# display and print method works - html -----------------------------

0 commit comments

Comments
 (0)