Skip to content

Commit

Permalink
Fixing order of tests for half-hard
Browse files Browse the repository at this point in the history
  • Loading branch information
pbulsink committed Oct 22, 2024
1 parent f5162f5 commit df49faa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/testthat/test-io.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,15 @@ 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)
}

if(!requireNamespace("R.utils", quietly = TRUE)) {
expect_error(plotftir_to_chemospec(biodiesel), regexp = "requires R.utils package installation for this function.", fixed = TRUE)
testthat::skip("R.utils not available for testing interface")
}

if(!requireNamespace("ChemoSpec", quietly = TRUE) || !requireNamespace("R.utils", quietly = TRUE)){
testthat::skip("ChemoSpec or R.utils not available for testing interface")
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)
testthat::skip("ChemoSpec not available for testing interface")
}

data("SrE.IR", package = "ChemoSpec", envir = environment())
Expand Down

0 comments on commit df49faa

Please sign in to comment.