tests/testthat/test_parseImage.R

# Tests for parseImage function
# ------------------------------------------------------------------------------

context("Testing parseImage")
# These tests were created to ensure that the parseImage functions works
# correctly and creates a grob

# Test parseImage 
# ------------------------------------------------------------------------------

# load image
imgPath <-  file.path(system.file(package = "Spaniel"), 
                      "HE_Rep1_resized.jpg")
testGrob <- parseImage(imgPath)

test_that("parseImage loads an image and creates a grob", {
    expect_is(testGrob, c("rastergrob","grob","gDesc"))
})

Try the Spaniel package in your browser

Any scripts or data that you put into this service are public.

Spaniel documentation built on Nov. 8, 2020, 5:54 p.m.