From c462abf278caf0ac402404b08f851cb4fb1690cc Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 29 Feb 2024 16:51:13 -0800 Subject: [PATCH] Make test less sensitive to local conditions --- tests/testthat/_snaps/utils-ui.md | 8 ++++---- tests/testthat/test-utils-ui.R | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/testthat/_snaps/utils-ui.md b/tests/testthat/_snaps/utils-ui.md index 6c3e4a7a8..b738a1af3 100644 --- a/tests/testthat/_snaps/utils-ui.md +++ b/tests/testthat/_snaps/utils-ui.md @@ -418,9 +418,9 @@ Message * Key: something great Code - kv_line("Interesting file", I("{.path {git_ignore_path('user')}}")) + kv_line("Interesting file", I("{.url {url}}")) Message - * Interesting file: '~/.gitignore_global' + * Interesting file: # kv_line() can treat value in different ways [fancy] @@ -449,7 +449,7 @@ Message • Key: something great Code - kv_line("Interesting file", I("{.path {git_ignore_path('user')}}")) + kv_line("Interesting file", I("{.url {url}}")) Message - • Interesting file: ~/.gitignore_global + • Interesting file:  diff --git a/tests/testthat/test-utils-ui.R b/tests/testthat/test-utils-ui.R index 78bfe0a42..c25a4917a 100644 --- a/tests/testthat/test-utils-ui.R +++ b/tests/testthat/test-utils-ui.R @@ -209,6 +209,7 @@ cli::test_that_cli("kv_line() can treat value in different ways", { value <- "some value" adjective <- "great" + url <- "https://usethis.r-lib.org/" expect_snapshot({ # evaluation in .envir @@ -225,6 +226,6 @@ cli::test_that_cli("kv_line() can treat value in different ways", { # I() indicates value has markup kv_line("Key", I("something {.emph important}")) kv_line("Key", I("something {.emph {adjective}}")) - kv_line("Interesting file", I("{.path {git_ignore_path('user')}}")) + kv_line("Interesting file", I("{.url {url}}")) }) }, configs = c("plain", "fancy"))