bogdan/accept_values_for — pull request #12 by laserlemon (2014-03-03 12:33:53+00:00)
Title: Organize code and simplify the matcher

:warning: This is a work in progress. Feedback requested.

This refactor:

* moves matcher logic into its own `Matcher` class
* takes the `accept_values_for` method out of the global object space
* removes the test suite's dependency on Active Record
* refactors the matcher logic for simplicity
* reformats error messages for clarity

:speak_no_evil: Slightly controversial: I removed the feature that attempts to revert the model to its previous state. I'd like your feedback on the removal. My thoughts are:

* there is no contract/guarantee that calling the setter method with the original value will restore the model instance to its original data state (consider the case of `password=` that performs secure hashing)
* there are no existing code examples of how this feature might be used or necessary
* each `accept_values_for` test (as in your documented examples) should have the single responsibility of testing validations and *shouldn't* carry on with the original model afterwards to test it further

I'd appreciate your thoughts on the changes.