thoughtbot/shoulda-matchers — pull request #177 by seekafire (2012-10-23 15:31:43+00:00)
Title: Use submatchers instead of inheritance for ValidatesNumericalityMatcher.

This is the first step/proof of concept of a broader refactoring. It is based on using a standard interface and composition rather than inheritance when constructing matchers.

Benefits:

- Easier to add additional conditions to matchers (e.g. #only_integer, #with_message)
- Better testability for individual conditions, as they are matchers in their own right
- More code reusability as matchers are simply composed of other matchers
- Matchers only need to implement the parts of the interface they use
- Less reliance on inheritance