From 718e4f6c73ac5d7c6fb0e31d7c6478e2ae2df3f1 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 28 Oct 2022 18:39:11 +0200 Subject: [PATCH] Add informative message to the test Co-authored-by: Winston Chang --- tests/testthat/test-cloning-inheritance.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-cloning-inheritance.R b/tests/testthat/test-cloning-inheritance.R index 7bedb1f..11e7b60 100644 --- a/tests/testthat/test-cloning-inheritance.R +++ b/tests/testthat/test-cloning-inheritance.R @@ -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)