Skip to content

Commit 37e49c3

Browse files
committed
Fix deprecation of path argument
1 parent 3a52b54 commit 37e49c3

File tree

5 files changed

+11
-248
lines changed

5 files changed

+11
-248
lines changed

R/compat-lifecycle.R

Lines changed: 0 additions & 227 deletions
This file was deleted.

R/expect-doppelganger.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ expect_doppelganger <- function(title,
104104
if (lifecycle::is_present(path)) {
105105
lifecycle::deprecate_soft(
106106
"1.0.0",
107-
"vdiffr::expect_doppelganger(cran = )",
107+
"vdiffr::expect_doppelganger(path = )",
108108
)
109109
}
110110

tests/testthat/mock-pkg/tests/testthat/test-failed.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ skip_if_maintenance <- function() {
1212

1313
test_that("mismatches are hard failures when NOT_CRAN is set", {
1414
skip_if_maintenance()
15-
expect_doppelganger("myplot", p1_fail, "")
15+
expect_doppelganger("myplot", p1_fail)
1616
})
1717

1818
test_that("Duplicated expectations issue a warning", {
1919
skip_if_maintenance()
20-
expect_doppelganger("myplot", p1_fail, "")
20+
expect_doppelganger("myplot", p1_fail)
2121
})
2222

2323
test_that("mismatches are hard failures when CI is set", {
2424
skip_if_maintenance()
2525
withr::local_envvar(c(NOT_CRAN = "", CI = "true"))
26-
expect_doppelganger("myplot", p1_fail, "")
26+
expect_doppelganger("myplot", p1_fail)
2727
})
2828

2929
test_that("mismatches are skipped when NOT_CRAN is unset", {
3030
skip_if_maintenance()
3131
withr::local_envvar(c(NOT_CRAN = "", CI = ""))
32-
expect_doppelganger("myplot", p1_fail, "")
32+
expect_doppelganger("myplot", p1_fail)
3333
})
3434

3535

@@ -39,5 +39,5 @@ test_that("(maintenance) Reset failing figure", {
3939
if (!maintenance) {
4040
skip("maintenance")
4141
}
42-
expect_doppelganger("myplot", p1_orig, "")
42+
expect_doppelganger("myplot", p1_orig)
4343
})

tests/testthat/mock-pkg/tests/testthat/test-new.R

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ p2 <- ggplot2::ggplot(mtcars, ggplot2::aes(disp)) +
55
ggplot2::geom_histogram()
66

77
test_that("New plots are collected", {
8-
expect_doppelganger("new1", p1, "")
9-
expect_doppelganger("new2", p2, "")
10-
})
11-
12-
test_that("Figs are saved to alternative paths", {
13-
expect_doppelganger("alt1", p1, "path1")
14-
expect_doppelganger("alt2", p2, "path2")
15-
})
16-
17-
test_that("Figs are saved to context subfolders", {
18-
expect_doppelganger("context1", p1)
19-
expect_doppelganger("context2", p2)
8+
expect_doppelganger("new1", p1)
9+
expect_doppelganger("new2", p2)
2010
})

tests/testthat/mock-pkg/tests/testthat/test-passed.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ library("vdiffr")
22

33
test_that("ggplot doppelgangers pass", {
44
p1_orig <- ggplot2::ggplot(mtcars, ggplot2::aes(disp)) + ggplot2::geom_histogram()
5-
expect_doppelganger("myplot", p1_orig, "")
5+
expect_doppelganger("myplot", p1_orig)
66
})
77

88
test_that("base doppelgangers pass", {
99
p_base <- function() plot(mtcars$disp)
10-
expect_doppelganger("myplot2", p_base, "")
10+
expect_doppelganger("myplot2", p_base)
1111

1212
p_base_symbol <- function() {
1313
plot.new()
1414
text(0.5, 0.8, expression(x[i] + over(x, y)), font = 5)
1515
}
1616

17-
expect_doppelganger("Base doppelganger with symbol", p_base_symbol, "")
17+
expect_doppelganger("Base doppelganger with symbol", p_base_symbol)
1818
})
1919

2020
library("grid")

0 commit comments

Comments
 (0)