Skip to content

Commit

Permalink
Merge branch 'main' into m7pr-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr authored Nov 11, 2024
2 parents 15a3a07 + b3e5da3 commit a24236c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal.data
Title: Data Model for 'teal' Applications
Version: 0.6.0.9017
Date: 2024-11-08
Version: 0.6.0.9018
Date: 2024-11-11
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9533-457X")),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal.data 0.6.0.9017
# teal.data 0.6.0.9018

### Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion R/deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ datanames <- function(x) {
"`datanames<-`()",
details = "invalid to use `datanames()<-` or `names()<-` on an object of class `teal_data`. See ?names.teal_data"
)
names(x)
x
}

#' @rdname datanames
Expand Down
34 changes: 34 additions & 0 deletions tests/testthat/test-deprecated.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
testthat::describe("datanames deprecation: ", {
testthat::it("setter does nothing to object", {
td <- teal_data() |>
within({
iris <- iris
mtcars <- mtcars
})

# ignore deprecation warnings
withr::local_options(lifecycle_verbosity = "quiet")
datanames(td) <- c("mtcars")

testthat::expect_equal(
td,
teal_data() |>
within({
iris <- iris
mtcars <- mtcars
})
)
})

testthat::it("getter returns same as `names()`", {
td <- teal_data() |>
within({
iris <- iris
mtcars <- mtcars
})

# ignore deprecation warnings
withr::local_options(lifecycle_verbosity = "quiet")
testthat::expect_setequal(datanames(td), names(td))
})
})

0 comments on commit a24236c

Please sign in to comment.