context("Caching Study RC")
test_that("Caching features work", {
tmp_cache_filename = "tmp_cached_study.Rds"
if (file.exists(tmp_cache_filename)) {
file.remove(tmp_cache_filename)
}
s1 = create_study(tmp_cache_filename)
s1$series_matrix_filename = system.file(
"extdata/GSE26471",
"GSE26471_exp_grp.tab.gz",
package = "epimeddata"
)
s1$gse = "GSE26471"
s1$platform_filename = "foo/bar/baz"
s1$save()
s2 = create_study(tmp_cache_filename)
for (f in names(s2$getRefClass()$fields())) {
expect_equal(s2[[f]], s1[[f]])
}
tmp2_cache_filename = "tmp2_cached_study.Rds"
if (file.exists(tmp2_cache_filename)) {
file.remove(tmp2_cache_filename)
}
s2$save(tmp2_cache_filename)
s3 = create_study(tmp2_cache_filename)
for (f in names(s3$getRefClass()$fields())) {
expect_equal(s2[[f]], s3[[f]])
}
expect_true(s2$cache_filename == s3$cache_filename)
expect_false(s1$cache_filename == s3$cache_filename)
file.remove(c(tmp2_cache_filename, tmp_cache_filename))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.