Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Commit

Permalink
Allow more flexible error message
Browse files Browse the repository at this point in the history
Error messages on R 3.7 are different to what I expected. This
commit matches the error message more flexibly so that I still
catch the key component of the error message while making the tests
more robust.
  • Loading branch information
maurolepore committed Dec 6, 2019
1 parent 5ffc97f commit 190242c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@
language: R
sudo: false
cache: packages
latex: false

matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-match_all_against_all.R
Expand Up @@ -143,7 +143,7 @@ test_that("match_all_against_all checks used dots", {

expect_error(
match_all_against_all(x, y, bad_argument = "bad_argument"),
"problematic arguments",
"bad_argument",
class = "rlib_error_dots_unused"
)
})
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-string_similarity.R
Expand Up @@ -59,7 +59,7 @@ test_that("string_similariry errors with misspelled argument passed to `...`", {
# Misspelled weight as weig(th)
expect_error(
string_similarity(x, y, method = "jw", p = 0.1, weigth = weights),
"problematic.*weigth",
"weigth",
class = "rlib_error_dots_unused"
)
})
Expand All @@ -68,7 +68,7 @@ test_that("string_similariry errors with misspelled `method`", {
expect_error(string_similarity("a", "a", method = "jw"), NA)
expect_error(
string_similarity("a", "a", metod = "jw"),
"problematic.*metod",
"metod",
class = "rlib_error_dots_unused"
)
})

0 comments on commit 190242c

Please sign in to comment.