Skip to content

Commit

Permalink
tests: group together new tests under describe/it
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Nov 15, 2024
1 parent 073f3b9 commit 300b789
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions tests/testthat/test-init.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,32 @@ testthat::test_that(
}
)

testthat::test_that(
"init throws warning when datanames in modules has reserved name",
{
testthat::describe("init throws warning when datanames in modules has reserved name", {
testthat::it("`all`", {
testthat::expect_warning(
init(
data = teal.data::teal_data(all = mtcars),
modules = list(example_module())
),
"`all` is reserved for internal use\\. Please avoid using it as a dataset name\\."
)
}
)
})

testthat::it("`.raw_data` and `all`", {
td <-
testthat::expect_warning(
init(
data = teal.data::teal_data(
all = mtcars,
.raw_data = iris,
join_keys = teal.data::join_keys(teal.data::join_key(".raw_data", "all", "a_key"))
),
modules = list(example_module())
),
"`.raw_data` and `all` are reserved for internal use\\. Please avoid using them as dataset names\\."
)
})
})

testthat::test_that("init throws when dataname in filter incompatible w/ datanames in data", {
testthat::expect_warning(
Expand Down

0 comments on commit 300b789

Please sign in to comment.