Skip to content

Commit

Permalink
adding a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Jul 1, 2024
1 parent 17874db commit 2e7356d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/construction_helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
Code
data(api, package = "survey")
design <- survey::svydesign(id = ~1, weights = ~pw, data = apistrat)
construct_model(data = design, formula = api00 ~ api99, method = survey::svyglm,
method.args = list(iamnotavalidparameter = stats::gaussian()))
construct_model(data = design, formula = api00 ~ api99, method = "svyglm",
method.args = list(iamnotavalidparameter = stats::gaussian()), package = "survey")
Condition
Error in `construct_model()`:
! There was an error evaluating the model
! There was an error evaluating the model `svyglm(formula = api00 ~ api99, design = ., iamnotavalidparameter = stats::gaussian())`
Caused by error in `glm.control()`:
! unused argument (iamnotavalidparameter = list("gaussian", "identity", function (mu)
mu, function (eta)
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-construction_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ test_that("construct_model() messaging", {
construct_model(
data = design,
formula = api00 ~ api99,
method = survey::svyglm,
method.args = list(iamnotavalidparameter = stats::gaussian())
method = "svyglm",
method.args = list(iamnotavalidparameter = stats::gaussian()),
package = "survey"
)
}
)
Expand Down

0 comments on commit 2e7356d

Please sign in to comment.