tests/testthat/test-create_orchestrator.R

test_that("create_orchestrator creates a new orchestrator", {
  withr::with_tempdir({
    create_orchestrator("orchestrator" ,open = FALSE)
    expect_true(file.exists("orchestrator.R"))
  }) |>
    expect_message()
})

test_that("create_orchestrator aborts if file already exists", {

  withr::with_tempdir({
    expect_error({
      create_orchestrator(".", open = FALSE)
      create_orchestrator(".", open = FALSE)
    }, regexp = "already exists.")

    # Works if overwrite = TRUE
    expect_message(
      create_orchestrator(".", open = FALSE, overwrite = TRUE),
      regexp = "Overwriting existing"
    )
  })
}) |>
  suppressMessages()

Try the maestro package in your browser

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

maestro documentation built on June 8, 2025, 10:44 a.m.