Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using vdiffr unconditionally in package tests #93

Closed
gavinsimpson opened this issue Jan 6, 2021 · 0 comments
Closed

Using vdiffr unconditionally in package tests #93

gavinsimpson opened this issue Jan 6, 2021 · 0 comments
Assignees
Labels
cran All things related to keeping gratia on CRAN

Comments

@gavinsimpson
Copy link
Owner

Brian Ripley writes

Suggested packages should be used conditionally: see §1.1.3.1 of
'Writing R Extensions'. Some of the requirements of vdiffr are hard to
install on a platform without X11 such as M1 Macs: see the logs at
https://www.stats.ox.ac.uk/pub/bdr/M1mac/.

Lionel Harvey suggested the solution:

A simple way to make vdiffr usage conditional is to define your own
expect_doppelganger() as follows:

expect_doppelganger <- function(title, fig, path = NULL, ...) {
  testthat::skip_if_not_installed("vdiffr")
  vdiffr::expect_doppelganger(title, fig, path = path, ...)
}

You then call expect_doppelganger() without the vdiffr:: prefix.
See lionel-/ggstance@eac216f6.

Fix by Jan 12, 2021

@gavinsimpson gavinsimpson added the cran All things related to keeping gratia on CRAN label Jan 6, 2021
@gavinsimpson gavinsimpson self-assigned this Jan 6, 2021
@gavinsimpson gavinsimpson changed the title Using **vdiffr** unconditionally in package tests Using vdiffr unconditionally in package tests Jan 6, 2021
gavinsimpson added a commit that referenced this issue Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cran All things related to keeping gratia on CRAN
Projects
None yet
Development

No branches or pull requests

1 participant