Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fix graphics:plot dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael committed Mar 9, 2020
1 parent fdc6dca commit 4aba3c4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
14 changes: 10 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
Package: R62S3
Title: Automatic Method Generation from R6
Version: 1.4.0
Version: 1.4.1
Authors@R: person("Raphael", "Sonabend", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9225-4654"))
Description: After defining an R6 class, R62S3 is used to automatically generate optional S3/S4 generics and methods for dispatch. Also allows piping for R6 objects.
Depends: R (>= 3.5.0)
Imports: methods, data.table
Suggests: testthat, R6, pkgdown
Depends:
R (>= 3.5.0)
Imports:
data.table,
methods
Suggests:
pkgdown,
testthat,
R6
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# R62S3 1.4.1

* Fixed breakage due to `plot` being moved from `graphics` to `base`

# R62S3 1.4.0

## Minor Updates
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-R62Fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ test_that("no generic",{
expect_error(utils::isS3stdGeneric("R62Funprinter"))
})

plotter <- R6::R6Class("plotter", public = list(plot = function() return("I am plotting")))
plotter <- R6::R6Class("plotter", public = list(acos = function() return("I am plotting")))

test_that("detect = TRUE, mask = FALSE",{
expect_silent(R62Fun(plotter, detectGeneric = TRUE, mask = FALSE, assignEnvir = topenv()))
expect_equal(plot(plotter$new()), "I am plotting")
expect_equal(find("plot"), "package:graphics")
expect_equal(acos(plotter$new()), "I am plotting")
expect_equal(find("acos"), "package:base")
})

test_that("detect = FALSE, mask = TRUE",{
expect_silent(R62Fun(plotter, detectGeneric = FALSE, assignEnvir = topenv(), mask = TRUE))
expect_equal(plot(plotter$new()), "I am plotting")
expect_equal(names(formals(plot))[[1]], "object")
expect_equal(acos(plotter$new()), "I am plotting")
expect_equal(names(formals(acos))[[1]], "object")
})

0 comments on commit 4aba3c4

Please sign in to comment.