Closed perrygoy closed 1 year ago
This one is hard for me. I'm not a fan of either raising an exception when called without tests.
When this issue came up, I found it odd that
actor.shall(SeeAllOf())
would pass but
actor.shall(SeeAnyOf())
would fail.
I feel doing nothing should result in passing. Much like the following in pytest would result in passing.
def test_func():
pass
The above inconsistency is what I called into question.
While we also talked about if SeeAnyOf
should continue looping after it finds the first pass, I don't believe these two actions need to be consistent in their looping behavior. I feel it makes sense to match the common behavior of python for all()
vs any()
.
That said, this new change (failing without an argument) would be consistent behavior with any
and all
.
edit - that's what I get for not working on this for weeks at a time. We DID talk about the above and the latest changes reflect that.
This PR ensures both
SeeAnyOf
andSeeAllOf
behave consistently:UnableToAct
if they were not given any tests.SeeAnyOf
encounters a pass orSeeAllOf
encounters a failure.... and those were the two ways they were inconsistent! Well one way they were inconsistent and one new thing to handle.