dwww Home | Show directory contents | Find package

# https://github.com/tidyverse/reprex/issues/363
# ironically, reprex.advertise = FALSE + reprex(advertise = FALSE)
# resulted in reprex(advertise = TRUE) behaviour
test_that("reprex.advertise default detection isn't affected by the option", {
  full_list   <- list(advertise = FALSE, venue = "gh", session_info = FALSE)
  non_default <- list(advertise = FALSE)

  withr::with_options(
    list(reprex.advertise = TRUE),
    expect_equal(remove_defaults(full_list), non_default)
  )
  withr::with_options(
    list(reprex.advertise = FALSE),
    expect_equal(remove_defaults(full_list), non_default)
  )
  withr::with_options(
    list(reprex.advertise = NULL),
    expect_equal(remove_defaults(full_list), non_default)
  )
})

Generated by dwww version 1.15 on Tue Jul 2 08:48:08 CEST 2024.