specta/expecta — pull request #86 by paulsamuels (2014-03-15 15:02:39+00:00)
Title: Feature simplify apply matcher

The `EXPBlockDefinedMatcher` does not conform to the expected calling convention of `matches:`. A user would expect the value passed to `matches:` to be used in the matcher, but in the generated method body declared in `ExpectaSupport.h` the `actual` value is fetched a new by calling `self.actual`.

Although this currently works - it adds conceptual overhead and breaks if you want to work with collections - which is an open issue that some people appear to be working on.

As a result of this fix the `-[EXPExpect applyMathcer:to]` is now no longer useful as the `to` argument was only really being used as a flag to decide if there was actually an object available to test yet in async tests.

---

Fix broken calling convention for `-[EXPBlockDefinedMatcher matches:]` and Remove `-[EXPExpect applyMathcer:to]`

The summary of what is being changed is
- All block matchers are now called with `actual` rather than them asking their environment for `self.actual`
- `-[EXPExpect applyMathcer:to]` has been removed
- Any temp variables used in matchers that have their values derived from `actual` and were used within the `prerequisite`, `match`, `failureMessageForTo` and `failureMessageForNotTo` blocks have been wrapped in blocks to allow delayed execution as there is no longer an `actual` variable in the main scope of a matcher method.