Skip to content

Commit

Permalink
Merge branch 'pre-release-cleanup@main' of https://github.com/insight…
Browse files Browse the repository at this point in the history
…sengineering/teal into pre-release-cleanup@main
  • Loading branch information
kartikeyakirar committed Jan 24, 2024
2 parents c2ac0a4 + c4b206d commit 5880bc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ init <- function(data,
## `data` - `modules`
if (inherits(data, "teal_data")) {
if (length(teal_data_datanames(data)) == 0) {
stop("`data` object has no datanames and its environment is empty. Specify `datanames(data)` and try again.")
stop("The environment of `data` is empty.")
}
# in case of teal_data_module this check is postponed to the srv_teal_with_splash
is_modules_ok <- check_modules_datanames(modules, teal_data_datanames(data))
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-init.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ testthat::test_that("init filter accepts `teal_slices`", {
})

# data + modules ----
testthat::test_that("init throws when data has no datanames", {
testthat::test_that("init throws when an empty `data` is used", {
testthat::expect_error(
init(data = teal_data(), modules = list(example_module())),
"`data` object has no datanames and its environment is empty"
"The environment of `data` is empty."
)
})

Expand Down

0 comments on commit 5880bc7

Please sign in to comment.