tests/testthat/test-xl_open.R

test_that("xl_open() works", {
  wb <- wb_workbook()$add_worksheet(1)
  # throw a warning
  expect_warning(expect_s3_class(wb$open(interactive = FALSE), c("R6", "wbWorkbook")))
  # should not change the path object
  expect_identical(wb$path, character())
})

Try the openxlsx2 package in your browser

Any scripts or data that you put into this service are public.

openxlsx2 documentation built on April 3, 2025, 8:40 p.m.