diff --git a/src/create_task_readme/test.R b/src/create_task_readme/test.R index d2f18ed..dd4c816 100644 --- a/src/create_task_readme/test.R +++ b/src/create_task_readme/test.R @@ -6,25 +6,23 @@ requireNamespace("assertthat", quietly = TRUE) task_template <- "/task_template" output_path <- "output.md" setwd(task_template) -system("ls -l ") -# cat(">> Running the script as test\n") -# system(paste( -# meta["executable"], -# "--output", output_path, -# "--task_dir", paste0(task_template, "/src"), -# "--viash_yaml", paste0(task_template, "/_viash.yaml") -# )) +cat(">> Running the script as test\n") +system(paste( + meta["executable"], + "--output", output_path, + "--task_dir", "/src" +)) -# cat(">> Checking whether output files exist\n") -# assertthat::assert_that(file.exists(output_path)) +cat(">> Checking whether output files exist\n") +assertthat::assert_that(file.exists(output_path)) -# cat(">> Checking file contents\n") -# lines <- readLines(output_path) -# assertthat::assert_that(any(grepl("# Task Template ", lines))) -# assertthat::assert_that(any(grepl("# Description", lines))) -# assertthat::assert_that(any(grepl("# Motivation", lines))) -# assertthat::assert_that(any(grepl("# Authors", lines))) -# assertthat::assert_that(any(grepl("flowchart LR", lines))) -# assertthat::assert_that(any(grepl("# File format:", lines))) +cat(">> Checking file contents\n") +lines <- readLines(output_path) +assertthat::assert_that(any(grepl("# Task Template ", lines))) +assertthat::assert_that(any(grepl("# Description", lines))) +assertthat::assert_that(any(grepl("# Motivation", lines))) +assertthat::assert_that(any(grepl("# Authors", lines))) +assertthat::assert_that(any(grepl("flowchart LR", lines))) +assertthat::assert_that(any(grepl("# File format:", lines))) cat("All checks succeeded!\n")