petejkim/expecta — pull request #14 by lukeredpath (2012-03-26 16:35:01+00:00)
Title: Extract matcher functionality to its own class and protocol

These changes are based off TrahDavid's fork (he has his own outstanding pull request).

I'm writing a library that I want to bundle some Expecta matchers with. What I really wanted to do was just provide some matcher classes that can integrate with Expecta but the existing design didn't really allow from this.

What I've done is introduce a new EXPMatcher protocol for matching. I've also created an EXPBlockDefinedMatcher class which is a concrete implementation of this protocol, and wraps the existing method of constructing matchers (moving the storage of matcher blocks out of EXPExpects).

A test case is included for this new ability and all existing tests pass. Existing matchers required no modification.