From 1eae425a36e869701d38e4d81db59c68e75afddf Mon Sep 17 00:00:00 2001 From: Sam Rogers <7007561+rogerssam@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:25:35 +0930 Subject: [PATCH] Updating install asreml and tests --- R/install_asreml.R | 4 ++-- tests/testthat/test-zzz_install_asreml.R | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/R/install_asreml.R b/R/install_asreml.R index 3e231b3..40b2ddd 100644 --- a/R/install_asreml.R +++ b/R/install_asreml.R @@ -281,11 +281,11 @@ manage_file <- function(save_file, keep_file, filename) { } # If keep_file is FALSE, remove file - if(!keep_file) { + if(isFALSE(keep_file)) { unlink(save_file) result <- TRUE } - else if(keep_file) { + else if(isTRUE(keep_file)) { # If keep_file is true, copy asreml to current directory result <- tryCatch( expr = { diff --git a/tests/testthat/test-zzz_install_asreml.R b/tests/testthat/test-zzz_install_asreml.R index e18f5a6..13b3240 100644 --- a/tests/testthat/test-zzz_install_asreml.R +++ b/tests/testthat/test-zzz_install_asreml.R @@ -30,7 +30,8 @@ test_that("Prints message if asreml already installed", { skip_on_cran() skip_on_ci() install_asreml(quiet = TRUE) - expect_message(install_asreml(), "ASReml-R is already installed.") + expect_message(install_asreml(), + "The latest version of ASReml-R available for your sysetm is already installed\\. To install anyway, set `force = TRUE`\\.") }) test_that("Quiet returns no output", {