Skip to content

Commit cc606af

Browse files
committed
test grouping only before tsibble 1.1.5
1 parent 35c38a8 commit cc606af

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/testthat/test-as_tibble-decay.R

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test_that("as_tibble checks an attr to avoid decay to tibble", {
88
})
99

1010
test_that("as_tibble ungroups if needed", {
11+
skip_if(packageVersion("tsibble") > "1.1.4")
1112
edf <- jhu_csse_daily_subset %>% group_by(geo_value)
1213
# removes the grouped_df class
1314
expect_identical(class(as_tibble(edf)), c("tbl_df", "tbl", "data.frame"))

tests/testthat/test-methods-epi_df.R

+11-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,17 @@ test_that("Correct metadata when subset includes some of other_keys", {
121121
# Including both original other_keys was already tested above
122122
})
123123

124-
test_that("Metadata and grouping are dropped by `as_tibble`", {
124+
test_that("Metadata is dropped by `as_tibble`", {
125+
grouped_converted <- toy_epi_df %>%
126+
group_by(geo_value) %>%
127+
as_tibble()
128+
expect_true(
129+
!any(c("metadata") %in% names(attributes(grouped_converted)))
130+
)
131+
})
132+
133+
test_that("Grouping are dropped by `as_tibble`", {
134+
skip_if(packageVersion("tsibble") > "1.1.4")
125135
grouped_converted <- toy_epi_df %>%
126136
group_by(geo_value) %>%
127137
as_tibble()

0 commit comments

Comments
 (0)