tests/testthat/test-DC-summary.R

context("Summary")
test_that("Summary", {
  suppressWarnings({
    test <- defineClass("test", {
      x <- publicValue(1)
      .y <- NULL
      doSomething <- publicFunction(function() {
        .y <<- .y + 1
        invisible(self)
      })
    })
  })
  
  instance <- test()
  df <- summary(instance)
  expect_is(df, "data.frame")
  expect_equal(nrow(df), 7)
  expect_equal(sort(df$Name), 
               sort(c("doSomething", "self", ".self", "x", "x.validity", "x.x", ".y")))
  
})

Try the aoos package in your browser

Any scripts or data that you put into this service are public.

aoos documentation built on May 2, 2019, 3:47 p.m.