Skip to content

Commit

Permalink
Fixing failures in CHK Hard
Browse files Browse the repository at this point in the history
  • Loading branch information
pbulsink committed Oct 22, 2024
1 parent 3837f85 commit 72b54d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/io.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')}"
))
}

Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-io.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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)){
Expand Down

0 comments on commit 72b54d6

Please sign in to comment.