tests/testthat/test_capture.R

test_that("`capture.data_request` fails for unknown `type", {
  x <- request_data()
  x$type <- "something"
  capture(x) |> expect_error()
})

test_that("`capture.metadata_request` fails for unknown `type", {
  x <- request_metadata()
  x$type <- "something"
  capture(x) |> expect_error()
})

test_that("`capture.files_request` fails for unknown `type", {
  x <- request_files()
  x$type <- "something"
  capture(x) |> expect_error()
})

test_that("`capture.list()` converts class to `prequery`", {
  list(type = "occurrences", atlas = "Global") |>
    capture() |>
    expect_s3_class("prequery")
})

Try the galah package in your browser

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

galah documentation built on Nov. 20, 2026, 5:07 p.m.