@@ -46,19 +46,21 @@ test_that("metadata-file and metadata are merged in quarto_render", {
4646 )
4747})
4848
49-
5049test_that(" `quarto_render(as_job = TRUE)` is wrapable" , {
51- skip_if(is.null(quarto_path()))
50+ skip_on_cran() # this is to test inside RStudio IDE interactively
51+ skip_if_no_quarto()
5252 skip_if_not_installed(" rstudioapi" )
53- skip_if_not_installed(" rprojroot" )
5453 skip_if_not(rstudioapi :: isAvailable())
55- dir <- rprojroot :: find_testthat_root_file()
56- input <- file.path(dir , " test.Rmd" )
57- output <- file.path(dir , " test.html" )
58- wrapper <- function (path ) quarto_render(path , quiet = TRUE , as_job = TRUE )
59- wrapper(input )
54+ qmd <- local_qmd_file(c(" content" ))
55+ withr :: local_dir(dirname(qmd ))
56+ output <- basename(
57+ withr :: local_file(xfun :: with_ext(qmd , " .native" ))
58+ )
59+ wrapper <- function (path , out , format ) {
60+ quarto_render(path , output_file = out , output_format = format , quiet = TRUE , as_job = TRUE )
61+ }
62+ wrapper(basename(qmd ), output , " native" )
6063 # wait for background job to finish (10s should be conservative enough)
6164 Sys.sleep(10 )
6265 expect_true(file.exists(output ))
63- unlink(output )
6466})
0 commit comments