Skip to content

Commit

Permalink
update test create_readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiWaldrant committed Aug 8, 2024
1 parent d395aa1 commit cdaee05
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/create_task_readme/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit cdaee05

Please sign in to comment.