context("YouTube Links")
test_that("YouTube links identified correctly", {
slide <- ""
youtube_link1 <- ""
youtube_link2 <- ""
# ensure that PNGs not identified as youtube link
png <- grep(pattern = yt_pattern(), slide, perl = TRUE)
# ensure both versions of youtube links *are* identified as links
yt <- grep(pattern = yt_pattern(), youtube_link1, perl = TRUE)
yt2 <- grep(pattern = yt_pattern(), youtube_link2, perl = TRUE)
# test length
expect_length(png, 0)
expect_equal(yt, 1)
expect_equal(yt2, 1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.