context("Scorecard transaction check")
test_that("Check without scorecard invalid", {
rv <- scorecard_check()
expect_false(rv$valid)
rv <- scorecard_check(NA)
expect_false(rv$valid)
})
test_that("Check without transactions invalid", {
sf <- "testdata/scorecard.yml"
rv <- scorecard_check(sf)
expect_false(rv$valid)
rv <- scorecard_check(sf,NA)
expect_false(rv$valid)
})
test_that("Check with bogus files invalid",{
sf <- "testdata/scorecard.yml"
tf <- "testdata/missing.csv"
rv <- scorecard_check(sf,NA)
expect_false(rv$valid)
rv <- scorecard_check(sf,tf)
expect_false(rv$valid)
})
test_that("Check with proper file valid",{
sf <- "testdata/scorecard.yml"
tf <- "testdata/transactions.csv"
rv <- scorecard_check(sf,tf)
#print(rv)
#print(str(rv))
expect_true(rv$valid)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.