Skip to content

Commit

Permalink
More polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Nov 4, 2024
1 parent 288f99d commit 37005ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/reporter-progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ issue_header <- function(x, pad = FALSE) {
issue_summary <- function(x, rule = FALSE) {
header <- cli::style_bold(issue_header(x))
if (rule) {
header <- cli::rule(header, width = max(cli::ansi_nchar(header) + 6, 80))
header <- cli::rule(header)
}

paste0(header, "\n", format(x))
Expand Down
2 changes: 1 addition & 1 deletion R/snapshot-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ expect_snapshot_file <- function(path,

snapshotter <- get_snapshotter()
if (is.null(snapshotter)) {
snapshot_not_available("New path", path)
snapshot_not_available(path)
return(invisible())
}

Expand Down
8 changes: 4 additions & 4 deletions R/snapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ expect_snapshot_helper <- function(lab, val,

snapshotter <- get_snapshotter()
if (is.null(snapshotter)) {
snapshot_not_available("Current snapshot", save(val))
snapshot_not_available(save(val))
return(invisible())
}

Expand Down Expand Up @@ -322,12 +322,12 @@ snapshot_accept_hint <- function(variant, file, reset_output = TRUE) {
)
}

snapshot_not_available <- function(header, message) {
snapshot_not_available <- function(message) {
local_reporter_output()

cat(cli::rule(header), "\n", sep = "")
cat(cli::rule("Snapshot"), "\n", sep = "")
cli::cli_inform(c(
i = "Can't save snapshot or compare to reference when testing interactively."
i = "Can't save or compare to reference when testing interactively."
))
cat(message, "\n", sep = "")
cat(cli::rule(), "\n", sep = "")
Expand Down

0 comments on commit 37005ce

Please sign in to comment.