Closed danodonovan closed 5 years ago
The hamcrest calling and raises exception checking are quite useful. It would be nice if precisely had similar functionality.
calling
raises
I find the hamcrest syntax
assert_that(calling(func).with_args("arg"), raises(Exception))
quite intuitive. Would a direct replication be appropriate?
I'm not a fan of the syntax that Hamcrest uses. Specifically, I'd rather just use a lambda, and pass a matcher rather than exception type:
assert_that(lambda: func("arg"), raises(instance_of(Exception)))
The hamcrest
calling
andraises
exception checking are quite useful. It would be nice if precisely had similar functionality.I find the hamcrest syntax
assert_that(calling(func).with_args("arg"), raises(Exception))
quite intuitive. Would a direct replication be appropriate?