MichaelHackett / Kiwi

BDD for iOS
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add haveReceived:beforeLast: matcher and revise tests. #1

Closed MichaelHackett closed 11 years ago

MichaelHackett commented 11 years ago

After sketching out a full logic table for the in-order message verifier (KWHaveReceivedInOrderMatcher), I've discovered some reasonable cases that aren't handled and I think it would be worthwhile creating a full set of four matchers: beforeFirst, beforeLast, afterFirst, and afterLast. With these, and the use of "shouldNot" to perform exclusive tests, I think all the cases can be covered, and fairly cleanly at that.

I also think it would be easier to understand and reason about the unit tests for this matcher if the test conditions were simple "ab", "aba", "babba", etc., patterns, as opposed to the more descriptive versions there now. This should also allow the test parameters to be expressed more concisely, while making it easy to exhaustively test every case.

MichaelHackett commented 11 years ago

Added in 027a688.