richfitz / storr

:package: Object cacher for R
http://richfitz.github.io/storr
Other
116 stars 10 forks source link

Unit test warnings about custom error conditions #112

Closed wlandau closed 5 years ago

wlandau commented 5 years ago

After recent developments to testthat, expect_error() throws a warning for custom error conditions. Example:

test-storr.R:243: warning: get_value
`st$get_value("nosuchhash")` generated a condition with class HashError/error/condition.
It is less fragile to test custom conditions with `class`

The solution is simple: just supply a class argument to expect_error(). I will put together a PR after we resolve #111.