Skip to content

Commit

Permalink
Test deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Jul 4, 2023
1 parent cad1eaa commit 6482fa5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/_snaps/scales.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,15 @@
Discrete values supplied to continuous scale
i Example values: "A", "B", "C", "D", and "E"

# Using `scale_name` prompts deprecation message

The `scale_name` argument of `continuous_scale()` is deprecated as of ggplot2 3.5.0.

---

The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2 3.5.0.

---

The `scale_name` argument of `binned_scale()` is deprecated as of ggplot2 3.5.0.

8 changes: 8 additions & 0 deletions tests/testthat/test-scales.R
Original file line number Diff line number Diff line change
Expand Up @@ -670,3 +670,11 @@ test_that("find_scale appends appropriate calls", {
)

})

test_that("Using `scale_name` prompts deprecation message", {

expect_snapshot_warning(continuous_scale("x", "foobar", identity_pal()))
expect_snapshot_warning(discrete_scale("x", "foobar", identity_pal()))
expect_snapshot_warning(binned_scale("x", "foobar", identity_pal()))

})

0 comments on commit 6482fa5

Please sign in to comment.