tests/testthat/test-utils.R

test_that("ping", {
  expect_type(ping_ollama(), "logical")
  expect_type(ping_ollama(silent = TRUE), "logical")
  expect_no_message(ping_ollama(silent = TRUE))
})

test_that("verbose", {
  expect_no_message({
    skip_if_not(ping_ollama(silent = TRUE))
    op <- options("rollama_verbose" = FALSE)
    on.exit(options(op), add = TRUE, after = FALSE)
    query(q = "test", screen = FALSE)
  })
})

Try the rollama package in your browser

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

rollama documentation built on April 3, 2025, 7:48 p.m.