Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests. Add options to datapackage_skeleton to move data and dependencies into location in the package.
- Loading branch information
Showing
7 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1, name,value | ||
2, Red, 50 | ||
3, Blue, 200 | ||
4, Green, 10 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
}) |