Skip to content

Commit de7071e

Browse files
simonpcouchtopepo
andauthored
fix formatting in prompt_missing_implementation() (#804)
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
1 parent 728dc12 commit de7071e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

R/misc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ prompt_missing_implementation <- function(spec,
183183
msg <- c(
184184
"!" = "{.pkg parsnip} could not locate an implementation for `{cls}` {mode} \\
185185
model specifications{if (isTRUE(user_specified_engine)) {
186-
' using the `{engine}` engine' } else {''}}."
186+
paste0(' using the `', engine, '` engine')} else {''}}."
187187
)
188188

189189
if (nrow(avail) == 0 && nrow(all) > 0) {

tests/testthat/_snaps/fit_interfaces.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@
1212
i Please install (if needed) and load to continue.
1313

1414

15+
---
16+
17+
! parsnip could not locate an implementation for `cubist_rules` model specifications using the `Cubist` engine.
18+
i The parsnip extension package rules implements support for this specification.
19+
i Please install (if needed) and load to continue.
20+
21+

tests/testthat/test_fit_interfaces.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@ test_that('No loaded engines', {
109109
)
110110
expect_snapshot_error({cubist_rules() %>% fit(mpg ~., data = mtcars)})
111111
expect_snapshot_error({poisson_reg() %>% fit(mpg ~., data = mtcars)})
112+
expect_snapshot_error({cubist_rules(engine = "Cubist") %>% fit(mpg ~., data = mtcars)})
112113
})

0 commit comments

Comments
 (0)