Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/testthat/test-as_tibble-decay.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ test_that("as_tibble checks an attr to avoid decay to tibble", {
})

test_that("as_tibble ungroups if needed", {
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
skip_if(packageVersion("tsibble") > "1.1.4")
edf <- jhu_csse_daily_subset %>% group_by(geo_value)
# removes the grouped_df class
expect_identical(class(as_tibble(edf)), c("tbl_df", "tbl", "data.frame"))
Expand Down
13 changes: 12 additions & 1 deletion tests/testthat/test-methods-epi_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,18 @@ test_that("Correct metadata when subset includes some of other_keys", {
# Including both original other_keys was already tested above
})

test_that("Metadata and grouping are dropped by `as_tibble`", {
test_that("Metadata is dropped by `as_tibble`", {
grouped_converted <- toy_epi_df %>%
group_by(geo_value) %>%
as_tibble()
expect_true(
!any(c("metadata") %in% names(attributes(grouped_converted)))
)
})

test_that("Grouping are dropped by `as_tibble`", {
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
skip_if(packageVersion("tsibble") > "1.1.4")
grouped_converted <- toy_epi_df %>%
group_by(geo_value) %>%
as_tibble()
Expand Down