Skip to content

Commit

Permalink
Add informative message to the test
Browse files Browse the repository at this point in the history
Co-authored-by: Winston Chang <[email protected]>
  • Loading branch information
IndrajeetPatil and wch authored Oct 28, 2022
1 parent ff96e5d commit 718e4f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/testthat/test-cloning-inheritance.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test_that("Subclass can override superclass' cloneable property", {
Sheep <- R6Class("Sheep", inherit = Creature, cloneable = TRUE)
expect_message(sheep <- Sheep$new(), "Superclass Creature has cloneable=FALSE, but subclass Sheep has cloneable=TRUE.")
expect_error(sheep$clone(), "attempt to apply non-function")
# Make sure that the superclass wasn't inadvertantly modified.
expect_false("clone" %in% names(Creature$public_methods))

Human <- R6Class("Human", inherit = Creature, cloneable = FALSE)
Expand Down

0 comments on commit 718e4f6

Please sign in to comment.