tests/testthat/test-images_scrap.R

test_that(desc = "errors when mandatory arguments missing", {


expect_error(images_scrap())

expect_error(images_scrap("https://rstudio.com/"))


})


test_that(desc = "checking for errors when
          parameters are not of character string type", {



expect_error(images_scrap(link = 2342342423423))


expect_error(images_scrap(link = "https://rstudio.com/",
                          imgpath = getwd(),
                          extn = 123))

expect_error(images_scrap(link = "https://rstudio.com/",
                          imgpath = 2342423,
                          extn = "jpg"))

})


test_that(desc = "checking for error when
          'extn' is provided with a dot .", {

expect_error(images_scrap("https://rstudio.com/",
                          extn = ".jpg"))



})
feddelegrand7/ralger documentation built on March 14, 2023, 12:44 a.m.