busterjs/referee-combinators — pull request #2 by meisl (2013-02-10 20:09:59+00:00)
Title: rewrote tests, revealed (real) bug

I've pushed the tests a bit further in the direction started by @johlrogge, namely (more) similar to how assertions are tested in referee itself. I turned around a few things so the appearance is now a bit different.

Main goals were to have better test names, st. in case of failure (of referee-*combinators* tests) it's really clear and concise what has been tested,
and also to make it more flexible st. new kinds of tests can be added more easily (both pretty much achieved, IMO).
As an example for the latter: I found that it should be possible to give an optional failure message which should be passed on to the underlying "normal" assertion, and implemented it. What's missing is tests for it so that will show if I made the scheme sufficiently flexible.

Another thing (not yet done) is that we need to improve the way a failure / passing is being tested for, simple `[assert|refute].exception(..)` ain't enough. Consider `referee.throwOnFailure = false`...

What I did so far actually revealed a real bug (as opposed to bug in tests), as I think: `assert.equals(42, "42")` passes while `combinators.assert.equals(42)("42")` fails.
Well, ideally the tests for combinators should verify this statement: "ALL 'partially applied' assertions from combinators behave *exactly* like the 'normal' (except for how they're called)".