Skip to content

Commit 51ffc03

Browse files
committed
add test for message on unknown implementation
1 parent 9918043 commit 51ffc03

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/testthat/_snaps/misc.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# model type functions message informatively with unknown implementation
2+
3+
Code
4+
bag_tree() %>% set_engine("rpart")
5+
Message
6+
parsnip could not locate an implementation for `bag_tree` model specifications using the `rpart` engine.
7+
Output
8+
Bagged Decision Tree Model Specification (unknown)
9+
10+
Main Arguments:
11+
cost_complexity = 0
12+
min_n = 2
13+
14+
Computational engine: rpart
15+
16+

tests/testthat/test_misc.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,11 @@ test_that('correct mtry', {
9898

9999
})
100100

101+
# ----------------------------------------------------------------------------
102+
103+
test_that('model type functions message informatively with unknown implementation', {
104+
expect_snapshot(
105+
bag_tree() %>%
106+
set_engine("rpart")
107+
)
108+
})

0 commit comments

Comments
 (0)