tests/testthat/test-rqti_project.R

test_that("Project template creates expected files", {
    tmpdir <- tempdir()

    rqti:::rqti_project(tmpdir, templates = "YES", render = "OPAL",
                        start_server = "TRUE")
    src <- file.path(tmpdir, "main.R")
    lines <- readLines(src)
    lines <- lines[!grepl("render_|upload2", lines)]
    lines <- append(lines, "library(rqti)", 0)
    writeLines(lines, file.path(tmpdir, "main2.R"))
    source(file.path(tmpdir, "main2.R"), chdir = TRUE)

    # future improvements: check xml validity or created test
    expect_true(file.exists(file.path(tmpdir, "upload/test_demo.xml")))
    expect_true(file.exists(file.path(tmpdir, "upload/test_demo.zip")))
})

Try the rqti package in your browser

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

rqti documentation built on Feb. 23, 2026, 5:06 p.m.