context("check execution tests")
test_that("runCheck() works", {
checkFile <- system.file("extdata/dataset_title_length-check.xml", package = "metadig")
metadataFile <- system.file("extdata/example_EML.xml", package = "metadig")
results <- runCheck(checkFile, metadataFile)
result <- results[[1]]
# The title for the test EML file is too short, so this check should fail.
expect_match(result$status, "FAILURE")
expect_match(result$output[[1]]$value, ".*minimum required word count")
checkFile <- system.file("extdata/entity_attributes_sufficient_check.xml", package = "metadig")
results <- runCheck(checkFile, metadataFile)
result <- results[[1]]
# Some attributes descriptions aren't enough words, so this test should fail.
expect_match(result$status, "FAILURE")
checkFile <- system.file("extdata/datatype_check.xml", package = "metadig")
results <- runCheck(checkFile, metadataFile)
result <- results[[1]]
expect_match(result$status, "SUCCESS")
checkFile <- system.file("extdata/methods_present.xml", package = "metadig")
results <- runCheck(checkFile, metadataFile)
result <- results[[1]]
expect_match(result$status, "SUCCESS")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.