Skip to content

Commit

Permalink
expect_message -> expect_snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Sep 9, 2024
1 parent ebc0e73 commit 4562458
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/testthat/_snaps/boost_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
Error in `boost_tree()`:
! "bogus" is not a known mode for model `boost_tree()`.

---

Code
translate(boost_tree(mode = "classification"), engine = NULL)
Message
Used `engine = 'xgboost'` for translation.
Output
Boosted Tree Model Specification (classification)
Computational engine: xgboost
Model fit template:
parsnip::xgb_train(x = missing_arg(), y = missing_arg(), weights = missing_arg(),
nthread = 1, verbose = 0)

---

Code
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-boost_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that('updating', {

test_that('bad input', {
expect_snapshot(error = TRUE, boost_tree(mode = "bogus"))
expect_message(translate(boost_tree(mode = "classification"), engine = NULL))
expect_snapshot(translate(boost_tree(mode = "classification"), engine = NULL))
expect_snapshot(error = TRUE, translate(boost_tree(formula = y ~ x)))
})

Expand Down

0 comments on commit 4562458

Please sign in to comment.