diff --git a/tests/testthat/test-settings.R b/tests/testthat/test-settings.R index 3d7d0b31a..e3b944a2c 100644 --- a/tests/testthat/test-settings.R +++ b/tests/testthat/test-settings.R @@ -74,11 +74,9 @@ test_that("it errors if the config file does not end in a newline", { expect_error(read_settings("foo"), "Malformed config file") }) -test_that("with_defaults works as expected", { - # test capturing unnamed args - defaults <- with_defaults(assignment_linter) +test_that("with_defaults works as expected with unnamed args", { # assignment_linter is in defaults, so output doesn't change - expect_equal(names(defaults), names(with_defaults())) + expect_named(with_defaults(assignment_linter), names(with_defaults())) }) test_that("rot utility works as intended", { @@ -106,8 +104,8 @@ test_that("logical_env utility works as intended", { # fixing #774 test_that("with_defaults doesn't break on very long input", { - expect_equal( - names(with_defaults( + expect_named( + with_defaults( default = list(), lintr::undesirable_function_linter(c( detach = paste( @@ -120,7 +118,7 @@ test_that("with_defaults doesn't break on very long input", { "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) )) - )), + ), "lintr::undesirable_function_linter" ) })