-
Notifications
You must be signed in to change notification settings - Fork 19
/
test-skeleton-data-dependencies.R
58 lines (58 loc) · 1.36 KB
/
test-skeleton-data-dependencies.R
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
context("skeleton")
test_that("data, code, and dependencies are moved into place by skeleton", {
file <- system.file("extdata", "tests", "extra.rmd",
package = "DataPackageR")
ancillary <- system.file("extdata","tests","rfileTest.R",
package = "DataPackageR")
raw_data <- system.file("extdata", "tests", "raw_data",
package = "DataPackageR")
expect_null(
datapackage_skeleton(
name = "datatest",
path = tempdir(),
code_files = c(file),
force = TRUE,
r_object_names = "data",
raw_data_dir = raw_data,
dependencies = ancillary
)
)
expect_true(
file.exists(
normalizePath(
file.path(
tempdir(),
"datatest",
"inst",
"extdata",
"raw_data",
"testdata.csv"),
winslash = "/")
)
)
expect_true(
file.exists(
normalizePath(
file.path(
tempdir(),
"datatest",
"data-raw",
"extra.rmd"),
winslash = "/")
)
)
expect_true(
file.exists(
normalizePath(
file.path(
tempdir(),
"datatest",
"data-raw",
"rfileTest.R"),
winslash = "/")
)
)
unlink(file.path(tempdir(), "datatest"),
recursive = TRUE,
force = TRUE)
})