Skip to content

Commit 47e5905

Browse files
Fix missing java runtime (#38)
* fix java_check if runtime missing * fix mock of java_check
1 parent a4c1d7e commit 47e5905

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎R/selenium.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ java_check <- function() {
142142
if (identical(unname(javapath), "")) {
143143
stop("PATH to JAVA not found. Please check JAVA is installed.")
144144
}
145-
java_version <- suppressWarnings(system2(Sys.which("java"), "-version", stdout = TRUE, stderr = TRUE))
145+
java_version <- suppressWarnings(system2(javapath, "-version", stdout = TRUE, stderr = TRUE))
146146
if (!is.null(attr(java_version, "status"))) {
147147
stop(paste(java_version, collapse = "\n"))
148148
}

‎tests/testthat/test-selenium.R‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ test_that("errorIfVersionNotFound", {
7878
list_versions = mock_binman_list_versions_selenium,
7979
)
8080
local_mocked_bindings(
81-
Sys.which = function(...) {
81+
java_check = function(...) {
8282
"im here"
8383
},
84-
.package = "base"
8584
)
8685

8786
expect_error(

0 commit comments

Comments
 (0)