Skip to content

Commit

Permalink
strop readr spec attr from statelists (close #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybega committed Apr 14, 2021
1 parent 3dcd7aa commit 7c24deb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data-raw/cowstates.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ stopifnot(
nrow(cowstates[cowstates$microstate %in% TRUE, ])==(nrow(micro) - 2)
)

# drop readr spec attribute (#22)
attr(cowstates, "spec") <- NULL

usethis::use_data(cowstates, overwrite = TRUE)
3 changes: 3 additions & 0 deletions data-raw/gwstates.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ table(stringi::stri_enc_mark(gwstates$country_name))

gwstates <- as.data.frame(gwstates)

# drop readr spec attribute (#22)
attr(gwstates, "spec") <- NULL

usethis::use_data(gwstates, overwrite = TRUE)


Expand Down
Binary file modified data/gwstates.rda
Binary file not shown.
18 changes: 18 additions & 0 deletions tests/testthat/test-data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

test_that("gwstates is a plain data.frame", {
data(gwstates)
expect_identical(class(gwstates), "data.frame")

# no readr attribute
expect_null(attr(gwstates, "spec"))
})



test_that("cowstates is a plain data.frame", {
data(cowstates)
expect_identical(class(cowstates), "data.frame")

# no readr attribute
expect_null(attr(cowstates, "spec"))
})

0 comments on commit 7c24deb

Please sign in to comment.