Closed jdickey closed 8 years ago
Commit 1c78e0b basically demonstrates how we should have (re)written the asserters after writing the second very similar one. The other thing to notice is that, contrary to previous standard practice, the InduceError
and VerifyKeyInHash
support methods aren't namespaced at all; we anticipate (eventually) moving them someplace more easily reusable.
New Matcher Spec
A near-clone of what has gone before, particularly
assert_requires_initialize_parameter
andmust_require_initialize_parameter
.Given a class under test similar to
then we want a single-assertion test that failing to specify a supposedly required attribute value when initialising actually would trigger an error:
Without this custom matcher, one of the tests would look something like
Lots more boilerplate; much less clarity on what is actually being tested and why.