On Mar 5, 2009, at 11:55 , Nicolas Alpi wrote:
> For exemple on the Jshoulda tutorial, the assertLocalYipiyay is shared
> with the context block, but can I have a page called
> commno_tests_assertion with all my custom assertions ?
>
> I tried to add a :
>
> JsUnitTest.Unit.Assertions += { .... } but doesn't seems to work.
>
> Obviously if I put my custom assertion on the JsUnitTest file it
> works ... but I don't want to touch this file. Juts in case of update.
You should add your custom assertions to the
`JsUnitTest.Unit.Testcase.prototype`.
An example:
JsUnitTest.Unit.Testcase.prototype.assertCustom = function(expected,
actual, message) {
this.assertEqual(expected, actual, message);
};
> ps : Little typo in the JShoulda tutorial, section Unifying test
> runners (new in 1.2), jShoulda.unifyRunners(runners); should be
> jShoulda.unifyRunners(runner);
Oops, thanks. Fixed now.
--
Choan
<http://choangalvez.nom.es/>