diff --git a/tests/testthat/_snaps/before-1-4/create.md b/tests/testthat/_snaps/before-1-4/create.md index ff9ce43..0b43675 100644 --- a/tests/testthat/_snaps/before-1-4/create.md +++ b/tests/testthat/_snaps/before-1-4/create.md @@ -5,5 +5,5 @@ Condition Error in `check_quarto_version()`: ! `quarto create project` has been added in Quarto 1.4. See . - i You are using 1.3.433 from ''. + i You are using from ''. diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index 1e76e2c..c03d924 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -73,7 +73,7 @@ expect_snapshot_qmd_output <- function(name, input, output_file = NULL, ...) { } -transform_quarto_cli_in_output <- function(full_path = FALSE, normalize_path = FALSE) { +transform_quarto_cli_in_output <- function(full_path = FALSE, normalize_path = FALSE, version = FALSE) { return( function(lines) { if (full_path) { @@ -82,11 +82,14 @@ transform_quarto_cli_in_output <- function(full_path = FALSE, normalize_path = F lines <- gsub(quarto_found, "", lines, fixed = TRUE) # seems like there are quotes around path in CI windows lines <- gsub("\"\"", "", lines, fixed = TRUE) - return(lines) + } else { + # it will be quarto.exe only on windows + lines <- gsub("quarto\\.(exe|cmd)", "quarto", lines) } - - # it will be quarto.exe only on windows - gsub("quarto\\.(exe|cmd)", "quarto", lines) + if (version) { + lines <- gsub(quarto_version(), "", lines, fixed = TRUE) + } + return(lines) } ) } diff --git a/tests/testthat/test-create.R b/tests/testthat/test-create.R index 3178c7e..60d3e77 100644 --- a/tests/testthat/test-create.R +++ b/tests/testthat/test-create.R @@ -25,7 +25,7 @@ test_that("create project only available for 1.4", { expect_snapshot( error = TRUE, quarto_create_project(name = "test"), - transform = transform_quarto_cli_in_output(full_path = TRUE), + transform = transform_quarto_cli_in_output(full_path = TRUE, version = TRUE), variant = "before-1-4" ) })