From 09ecacf4b05fae15499fa4067fbca6b139e74bf2 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 20 Dec 2024 12:14:15 -0500 Subject: [PATCH 1/2] No need for status check --- tests/testthat/test-check-urls.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/testthat/test-check-urls.R b/tests/testthat/test-check-urls.R index ed335b1..b01a357 100644 --- a/tests/testthat/test-check-urls.R +++ b/tests/testthat/test-check-urls.R @@ -6,7 +6,6 @@ test_that("Test URL checks for OTTR main", { rmd_dir <- setup_ottr_template(type = "rmd", render = FALSE) status <- check_urls(rmd_dir) - testthat::expect_true(status == 0) # Make sure the report exists testthat::expect_true(file.exists(file.path(rmd_dir, output_file))) @@ -22,7 +21,6 @@ test_that("Test URL checks for OTTR Quarto main", { qmd_dir <- setup_ottr_template(type = "qmd", render = FALSE) status <- check_urls(qmd_dir) - testthat::expect_true(status == 0) # Make sure the report exists testthat::expect_true(file.exists(file.path(qmd_dir, output_file))) @@ -37,7 +35,6 @@ test_that("Test URL checks for OTTR web", { rmd_web <- setup_ottr_template(type = "rmd_website", render = FALSE) status <- check_urls(rmd_web, report_all = TRUE) - testthat::expect_true(status == 0) # Make sure the report exists testthat::expect_true(file.exists(file.path(rmd_web, output_file))) @@ -53,7 +50,6 @@ test_that("Test URL checks for OTTR Quarto web", { qmd_web <- setup_ottr_template(type = "quarto_website", render = FALSE) status <- check_urls(qmd_web, report_all = TRUE) - testthat::expect_true(status == 0) # Make sure the report exists testthat::expect_true(file.exists(file.path(qmd_web, output_file))) From 1953e5324ad4efe87ed03acbfc8e0dd3b9fa185b Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 20 Dec 2024 12:18:37 -0500 Subject: [PATCH 2/2] Fix test --- tests/testthat/test-check-urls.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-check-urls.R b/tests/testthat/test-check-urls.R index b01a357..d30d4c4 100644 --- a/tests/testthat/test-check-urls.R +++ b/tests/testthat/test-check-urls.R @@ -6,6 +6,7 @@ test_that("Test URL checks for OTTR main", { rmd_dir <- setup_ottr_template(type = "rmd", render = FALSE) status <- check_urls(rmd_dir) + testthat::expect_true(status < 2) # Make sure the report exists testthat::expect_true(file.exists(file.path(rmd_dir, output_file))) @@ -18,9 +19,10 @@ test_that("Test URL checks for OTTR main", { }) test_that("Test URL checks for OTTR Quarto main", { - qmd_dir <- setup_ottr_template(type = "qmd", render = FALSE) + qmd_dir <- setup_ottr_template(type = "quarto", render = FALSE) status <- check_urls(qmd_dir) + testthat::expect_true(status < 2) # Make sure the report exists testthat::expect_true(file.exists(file.path(qmd_dir, output_file))) @@ -35,6 +37,7 @@ test_that("Test URL checks for OTTR web", { rmd_web <- setup_ottr_template(type = "rmd_website", render = FALSE) status <- check_urls(rmd_web, report_all = TRUE) + testthat::expect_true(status < 2) # Make sure the report exists testthat::expect_true(file.exists(file.path(rmd_web, output_file))) @@ -50,6 +53,7 @@ test_that("Test URL checks for OTTR Quarto web", { qmd_web <- setup_ottr_template(type = "quarto_website", render = FALSE) status <- check_urls(qmd_web, report_all = TRUE) + testthat::expect_true(status < 2) # Make sure the report exists testthat::expect_true(file.exists(file.path(qmd_web, output_file)))