Skip to content

Commit

Permalink
chore: Error if ... includes unused options
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Dec 2, 2024
1 parent b163ffa commit 01a273c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/navs-legacy.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ navbar_options <- function(
underline = missing(underline)
)

rlang::check_dots_empty()

opts <- list(
position = rlang::arg_match(position),
bg = bg,
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-navs-legacy.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ test_that("navbar_options() print method", {
)
})

test_that("navbar_options() errors if ... swallows unused options", {
expect_error(navbar_options(foo = "bar"))
})

test_that("navbar_options_resolve_deprecated() consolidates correctly", {
# TODO-deprecated: Remove when direction options are deprecated with an error

Expand Down

0 comments on commit 01a273c

Please sign in to comment.