compliance-operator icon indicating copy to clipboard operation
compliance-operator copied to clipboard

Introduce a file for assertions

Open rhmdnd opened this issue 1 year ago • 2 comments

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.

rhmdnd avatar Sep 28 '23 14:09 rhmdnd