diff --git a/R/io.R b/R/io.R index 95748e5..7395c00 100644 --- a/R/io.R +++ b/R/io.R @@ -631,7 +631,7 @@ chemospec_to_plotftir <- function(csdata) { # Package checks if (!requireNamespace("ChemoSpec", quietly = TRUE)) { cli::cli_abort(c("{.pkg PlotFTIR} requires {.pkg ChemoSpec} package installation for this function.", - i = "Install {.pkg ir} with {.code install.packages('ChemoSpec')}" + i = "Install {.pkg ChemoSpec} with {.code install.packages('ChemoSpec')}" )) } diff --git a/tests/testthat/test-io.R b/tests/testthat/test-io.R index 838c02d..c8662c7 100644 --- a/tests/testthat/test-io.R +++ b/tests/testthat/test-io.R @@ -224,8 +224,8 @@ test_that("plot saves", { test_that("interface to ir is ok", { if (!requireNamespace("ir", quietly = TRUE)) { - expect_error(ir_to_plotftir(data.frame("testdata" = LETTERS)), regexp = "requires `ir` package installation for this function.", fixed = TRUE) - expect_error(ir_to_df(data.frame("testdata" = LETTERS)), regexp = "requires `ir` package installation for this function.", fixed = TRUE) + expect_error(ir_to_plotftir(data.frame("testdata" = LETTERS)), regexp = "requires ir package installation for this function.", fixed = TRUE) + expect_error(ir_to_df(data.frame("testdata" = LETTERS)), regexp = "requires ir package installation for this function.", fixed = TRUE) expect_error(plotftir_to_ir(biodiesel), regexp = "requires `ir` package installation for this function.", fixed = TRUE) testthat::skip("ir not available for testing interface") } @@ -260,12 +260,12 @@ test_that("interface to ir is ok", { test_that("Interface to ChemoSpec is ok", { if (!requireNamespace("ChemoSpec", quietly = TRUE)) { - expect_error(chemospec_to_plotftir(data.frame("testdata" = LETTERS)), regexp = "requires `ChemoSpec` package installation for this function.", fixed = TRUE) - expect_error(plotftir_to_chemospec(biodiesel), regexp = "requires `ChemoSpec` package installation for this function.", fixed = TRUE) + expect_error(chemospec_to_plotftir(data.frame("testdata" = LETTERS)), regexp = "requires ChemoSpec package installation for this function.", fixed = TRUE) + expect_error(plotftir_to_chemospec(biodiesel), regexp = "requires ChemoSpec package installation for this function.", fixed = TRUE) } - if(!requireNamespace("R.utils", quietly = TRUE)) { - expect_error(plotftir_to_chemospec(biodiesel), regexp = "requires `R.utils` package installation for this function.", fixed = TRUE) + if(!requireNamespace("R.utils", quietly = TRUE) && requireNamespace("ChemoSpec", quietly = TRUE)) { + expect_error(plotftir_to_chemospec(biodiesel), regexp = "requires R.utils package installation for this function.", fixed = TRUE) } if(!requireNamespace("ChemoSpec", quietly = TRUE) || !requireNamespace("R.utils", quietly = TRUE)){