tests/testthat/test-csv_target.R

context('Unit tests for CSV target')

test_that('Test write, read and exists', {
  tmp <- data.frame(a = c(1,2,3), b = c(NA, NA, 4))
  tmpfile <- tempfile()
  trgt <- CSVtarget$new(tmpfile)
  expect_false(trgt$exists())
  trgt$write(tmp)
  expect_true(trgt$exists())
  expect_equal(tmp, trgt$read())
  unlink(tmpfile)
})
kirillseva/ruigi documentation built on June 6, 2019, 2:10 a.m.