Skip to content

Commit 4e21857

Browse files
committed
keep hiding full path in some case
1 parent e66a6b3 commit 4e21857

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

tests/testthat/_snaps/quarto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
Code
8686
quarto_binary_sitrep(debug = TRUE)
8787
Message
88-
v quarto R package will use '<quarto full path>\quarto.exe'
88+
v quarto R package will use '<quarto full path>'
8989
i It is configured to use the latest version found in the PATH environment variable.
9090
x RStudio IDE render button seems configured to use '<RSTUDIO_QUARTO path>'.
9191
! It is configured through `RSTUDIO_QUARTO` environment variable.
@@ -97,7 +97,7 @@
9797
Code
9898
quarto_binary_sitrep(debug = TRUE)
9999
Message
100-
v quarto R package will use '<quarto full path>\quarto.exe'
100+
v quarto R package will use '<quarto full path>'
101101
i It is configured to use the latest version found in the PATH environment variable.
102102
Output
103103
[1] TRUE

tests/testthat/_snaps/render.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Code
44
quarto_render("input.qmd", quiet = TRUE, quarto_args = c("--to", "native"))
55
Output
6-
Running <quarto full path>/quarto.exe render input.qmd --quiet --to native
6+
Running <quarto full path> render input.qmd --quiet --to native
77

tests/testthat/helper.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ expect_snapshot_qmd_output <- function(name, input, output_file = NULL, ...) {
133133

134134
transform_quarto_cli_in_output <- function(
135135
full_path = FALSE,
136-
version = FALSE
136+
version = FALSE,
137+
dir_only = FALSE
137138
) {
138139
hide_path <- function(lines, real_path) {
139140
gsub(
@@ -148,7 +149,9 @@ transform_quarto_cli_in_output <- function(
148149
function(lines) {
149150
if (full_path) {
150151
quarto_found <- find_quarto()
151-
quarto_found <- dirname(quarto_found)
152+
if (dir_only) {
153+
quarto_found <- dirname(quarto_found)
154+
}
152155
quarto_found_normalized <- normalizePath(quarto_found, mustWork = FALSE)
153156
# look for non-normalized path
154157
lines <- hide_path(lines, quarto_found)

tests/testthat/test-quarto.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ test_that("quarto_run report full quarto cli error message", {
2626
error = TRUE,
2727
quarto_inspect(),
2828
transform = transform_quarto_cli_in_output(
29-
full_path = TRUE
29+
full_path = TRUE,
30+
dir_only = TRUE
3031
)
3132
)
3233
})

0 commit comments

Comments
 (0)