tests/testthat/test-thing.R

thing_test <- mod::thing({
        a <- 1
}, dot = function()a)

test_that("thing() and its active binding works", {
        expect_true(mod::is_thing(thing_test))
        expect_equal(thing_test$., thing_test$a, thing_test[])
})

Try the mod package in your browser

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

mod documentation built on Aug. 23, 2019, 5:05 p.m.