1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
context("Constructor")
test_that("Creation of directories and checking of existing files", {
path = tempfile()
fail(path) # works on new dirs
fail(path) # works on existing dirs
path = tempfile()
file.create(path)
expect_error(fail(path))
})
test_that("Constructor checks input", {
path = tempfile()
expect_error(fail(path, extension="^"))
expect_error(fail(path, extension=".RData"))
})
test_that("Argument 'all.files' works", {
path = tempfile()
f = fail(path, all.files = FALSE)
expect_error(f$put(.x = 1), "hidden")
f = fail(path, all.files = TRUE)
f$put(.x = 1)
expect_equal(f$ls(), ".x")
})
|