alphagov/smartdown — pull request #51 by dsingleton (2014-09-09 11:36:07+00:00)
Title: Refactor: self-evaluating Predicates

Rather than having a single `Evaluator`, that acts on different predicate types, move the logic of evaluation into each predicate itself, and allow them to recursively resolve.

These commits are smaller steps to the overall goal, i'm happy to squash them before merging, but they make the diff more readable.

* https://github.com/alphagov/smartdown/commit/c806c1e2d366f298e4b74a56227a8f2603289b96 moves the evaluation logic into each predicate, and keeps the `Evaluator interface` to not it's clients, or tests.
* https://github.com/alphagov/smartdown/commit/21671b37e6b8cdfb5fac73fb41856060ea75afac moves predicate evaluation tests into individual predicate specs
* https://github.com/alphagov/smartdown/commit/3a7931116691cd8fde68c41ea0f88380f3d60a6e converts callers of `Evaluator` to evaluate predicates directly, then removes the Evaluator and it's refactors some tests that expected it, converting them to expect predicates.