busterjs/referee — pull request #11 by dymonaz (2014-07-01 21:25:53+00:00)
Title: Replacing array index based formats with object key based ones

This is in light of the following issues:
https://github.com/busterjs/buster/issues/272
https://github.com/busterjs/buster/issues/273
https://github.com/busterjs/buster/issues/274
https://github.com/busterjs/buster/issues/387

First step, as discussed, is to replace numeric based formats (`${0}`) in assertion messages with object key based ones (`${actual}`, `${expected}`, etc). Also in interpolation, `${customMessage}` gets a special treatment - it does not go via `referee.format()`, which means it should be safe to turn on quotes (original problem with 274 - but I haven't tested that part just yet).

While at it, I also refactored `assert.exception()`/`refute.exception()` to go via `referee.add()` - did it mostly to make sure, that interpolation only goes via one method - `this.fail()`, so that it's possible to eventually cleanup `customMessage` usages - while doing that, I think, I found the problem with 272/273 - will comment where relevant.