context("Checking rm_url") test_that("rm_url is removing/replacing url strings",{ x <- " I like www.talkstats.com and http://stackoverflow.com" x2 <- "I like and" x3 <- "I like and http://stackoverflow.com" expect_equivalent(rm_url(x), x2) expect_equivalent(rm_url(x, replacement = '\\1'), x3) }) test_that("rm_url is extracting url strings",{ x <- " I like www.talkstats.com and http://stackoverflow.com" x4 <- list(c("www.talkstats.com", "http://stackoverflow.com")) expect_equivalent(rm_url(x, extract=TRUE), x4) })