Skip to content
Snippets Groups Projects
Commit a3944300 authored by Todor Kondić's avatar Todor Kondić
Browse files

tests: Updated.

parent 942ee51a
No related branches found
No related tags found
No related merge requests found
ok_return_val <- function(fun_name,...) {
testthat::test_that(paste("function",fun_name,"returns correct result."),...)
}
gen_test_dirs <- function() {
tname = tempfile("shiny_test_dirs")
dirs = list(metfrag_db_dir = file.path(tname,"mfdb"))
dirs$top_data_dir = file.path(tname,"topdatadir")
dirs$projects = file.path(tname,"projects")
dir.create(tname)
for (dr in dirs) dir.create(dr)
dirs$root = tname
fn_db = system.file("testdata","example_db.csv",package="shinyscreen")
dirs
}
gen_test_project <- function() {
dirs = gen_test_dirs()
project = file.path(dirs$projects,"test_project")
dir.create(project)
}
......@@ -11,11 +11,13 @@ test_that("Preparation for app start",{withr::with_tempdir({
saveRDS("",file=mrt)
expect_error(prepare_app(dir_before=dbef,
projects="absent",
top_data_dir=ddata),
top_data_dir=ddata,
metfrag_db_dir=""),
class="projects-absent")
expect_error(prepare_app(dir_before=dbef,
projects=dproj,
top_data_dir="absent"),
top_data_dir="absent",
metfrag_db_dir=""),
class="top-data-dir-absent")
})})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment