test_that("pull_bed_stream works", {
# setup
con = tryCatch(
suppressWarnings(suppressMessages(bed_connection("COM3"))),
error = function(e) FALSE
)
if (isFALSE(con)) {
skip("unplugged connection")
} else {
tryCatch({
open(con)
withr::defer(close(con))
Sys.sleep(1)
# eval
stream <- pull_bed_stream(con)
# tests
expect_character(stream)
},
error = function(e) skip("unplugged connection")
)
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.