tests/testthat/test_zzz.R

context("Test zzz")

test_that("onLoad", {
    expect_equal(Sys.getlocale("LC_CTYPE"), "Chinese (Simplified)_China.936")
    expect_true(all(c("op", "A", "EE", "END_TAG", "XM_PI", "START_TAG", "CHAR2NUM_SCI",
                      "CHAR2NUM_NOSCI") %in% names(aseshms_env)))
    expect_equal(names(.pkgPara()), 
                 c("init.dir", "toolkit.dir", "init.pal", "na.string",
                   "mach.arch", "remote.pkg.dir", "aseshms.version",
                   "aseshms.latest.version", "guiToolkit" ))
})

test_that("on Unload", {
    setup({
        unload_pkgs("aseshms")
        expect_false(file.exists(paste0(Sys.getenv("HOME"), "/acckey.pem")))
    })
    teardown(library(aseshms))
})
madlogos/aseshms documentation built on May 21, 2019, 11:03 a.m.