tests/testthat/test_copy.R

# Copyright 2018 Opening Reproducible Research (https://o2r.info)

library("containerit")
context("COPY instruction")

test_that("A valid COPY instruction can be created" , {
  obj <- Copy(c("script.R","package_description"), "path/to/destination")
  expect_equal(toString(obj), "COPY [\"script.R\", \"package_description/\", \"path/to/destination/\"]")
})

test_that("Error with empty constructor" , {
  expect_error(Copy())
})

test_that("Error with only source constructor" , {
  expect_error(Copy("src"))
})

test_that("Error with only multiple destinations" , {
  expect_error(Copy(c("a","b"), c("dest","b")))
})
o2r-project/containerit documentation built on June 28, 2021, 2:46 p.m.