Skip to content

Commit cb85b03

Browse files
committed
check_facet_class() --> check_vars()
1 parent 806ded8 commit cb85b03

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

R/facet-.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ df.grid <- function(a, b) {
443443
# facetting variables.
444444

445445
as_facets_list <- function(x) {
446-
check_facet_class(x)
446+
check_vars(x)
447447
if (is_quosures(x)) {
448448
x <- quos_auto_name(x)
449449
return(list(x))
@@ -487,7 +487,7 @@ as_facets_list <- function(x) {
487487
x
488488
}
489489

490-
check_facet_class <- function(x) {
490+
check_vars <- function(x) {
491491
if (is.mapping(x)) {
492492
cli::cli_abort("Please use {.fn vars} to supply facet variables.")
493493
}

tests/testthat/_snaps/facet-.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Code
44
facet_wrap(aes(foo))
55
Condition
6-
Error in `check_facet_class()`:
6+
Error in `check_vars()`:
77
! Please use `vars()` to supply facet variables.
88

99
---
1010

1111
Code
1212
facet_grid(aes(foo))
1313
Condition
14-
Error in `check_facet_class()`:
14+
Error in `check_vars()`:
1515
! Please use `vars()` to supply facet variables.
1616

1717
# facet_grid() fails if passed both a formula and a vars()
@@ -73,7 +73,7 @@
7373
Error:
7474
! object 'no_such_variable' not found
7575

76-
# check_facet_class() provide meaningful errors
76+
# check_vars() provide meaningful errors
7777

7878
Please use `vars()` to supply facet variables.
7979

tests/testthat/test-facet-.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ test_that("eval_facet() is tolerant for missing columns (#2963)", {
469469
)
470470
})
471471

472-
test_that("check_facet_class() provide meaningful errors", {
473-
expect_snapshot_error(check_facet_class(aes(var)))
474-
expect_snapshot_error(check_facet_class(ggplot()))
472+
test_that("check_vars() provide meaningful errors", {
473+
expect_snapshot_error(check_vars(aes(var)))
474+
expect_snapshot_error(check_vars(ggplot()))
475475
})
476476

477477
test_that("check_layout() throws meaningful errors", {

0 commit comments

Comments
 (0)