compliance-operator
compliance-operator copied to clipboard
Introduce a file for assertions
We have a smattering of assertions in different files within the
framework
package. Even if you rely on your IDE to fill these in for
you, organizing them is good practice.
This commit adds a new file specifically for assertions, and populates it with an existing assertion used in tests.
It also implements the ability for assertions to handle test outcomes,
instead of returning booleans, forcing the callers to handle test
outcomes. Although having test outcomes (e.g., FailNow
) in the test is
clear, we check and call Fatal
a lot across the test code. Moving the
outcome into the assertion allows the code to be a little more dry, and
clear if everyone agrees assertions should accept that reponsibility.