Skip to content

Commit 5d7c5ae

Browse files
topepohfrick
andauthored
Apply suggestions from code review
Co-authored-by: Hannah Frick <[email protected]>
1 parent 0bd51ed commit 5d7c5ae

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

R/aaa_models.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ check_spec_mode_engine_val <- function(cls, eng, mode) {
244244
check_mode_with_no_engine <- function(cls, mode) {
245245
spec_modes <- get_from_env(paste0(cls, "_modes"))
246246
if (!(mode %in% spec_modes)) {
247-
stop_incompatible_mode(spec_modes, cls)
247+
stop_incompatible_mode(spec_modes, cls = cls)
248248
}
249249
}
250250

R/arguments.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ set_mode <- function(object, mode) {
7979
cls <- class(object)[1]
8080
if (rlang::is_missing(mode)) {
8181
spec_modes <- rlang::env_get(get_model_env(), paste0(cls, "_modes"))
82-
stop_incompatible_mode(spec_modes, cls)
82+
stop_incompatible_mode(spec_modes, cls = cls)
8383
}
8484
check_spec_mode_engine_val(cls, object$engine, mode)
8585
object$mode <- mode

tests/testthat/test_args_and_modes.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ test_that("unavailable modes for an engine and vice-versa", {
8585

8686
expect_error(
8787
proportional_hazards() %>% set_mode("regression"),
88-
"Available modes for engine proportional_hazards"
88+
"Available modes for model type proportional_hazards"
8989
)
9090

9191
expect_error(
9292
linear_reg() %>% set_mode(),
93-
"Available modes for engine linear_reg"
93+
"Available modes for model type linear_reg"
9494
)
9595

9696
expect_error(
@@ -105,4 +105,3 @@ test_that("unavailable modes for an engine and vice-versa", {
105105
})
106106

107107

108-

0 commit comments

Comments
 (0)