test_that("Plugin interface works", {
app <- App$new()
plugin <- expect_r6(Plugin$new("hello"), "Plugin")
expect_error(app$plugin_attach(plugin, bind = TRUE), NA)
expect_list(app$hello, len = 0L, names = "named")
expect_r6(app$plugins$hello, "Plugin")
expect_identical(app$plugins$hello$app, app)
app <- App$new()
plugin_requires <- expect_r6(Plugin$new("hi", "Plugin"), "Plugin")
expect_error(app$plugin_attach(plugin_requires))
app$plugin_attach(plugin)
expect_error(app$plugin_attach(plugin_requires), NA)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.