tests/testthat/test-ai_tool_read_file.R

test_that("read_file - invalid args", {
  expect_error(read_file(list()), "Invalid arguments for ReadFile")
})

test_that("read_file", {
  mock_file <- tempfile()
  writeLines("MOCK_CONTENT", mock_file)
  expect_equal(
    read_file(list(filepath = mock_file)),
    list(filepath = mock_file, content = "MOCK_CONTENT")
  )
})

Try the myownrobs package in your browser

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

myownrobs documentation built on Nov. 5, 2025, 5:52 p.m.