tests/testthat/test-example.R

test_that("NULL path returns names of example files", {
  example_files <- readxl_example()
  expect_true("datasets.xls" %in% example_files)
  expect_true("datasets.xlsx" %in% example_files)
  expect_true(is.character(example_files))
})

test_that("providing example file name returns full path", {
  expect_true(file.exists(readxl_example("datasets.xlsx")))
})

Try the readxl package in your browser

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

readxl documentation built on July 9, 2023, 5:57 p.m.