== 1.2.1 2009-02-24
* New methods `useStyle` and `defineStyle`. Now for using the pair name "describe/it" all you have to do is
jShoulda.useStyle('describe');
Predefined styles are 'describe' for "describe/it" pair and 'context' or 'should' for the "context/should" pair.
`context` and `should` methods are still exported by default. This may change in next releases.
To define new styles, pass a style-name and a configuration object to `jShoulda.defineStyle`. Properties expected in the configuration are:
* context: an array containing names and connectors for the exportable _context_ methods
* should: an array containing names and connectors for the exportable _should_ methods
* (optional) unify: unify runners when using this style
Example:
// defining an style (better in an external shared script)
jShoulda
.defineStyle('my_custom_style', {
context: [ 'some', 'A' ],
should: [ 'does', '', 'and', '' ],
unify: true
});
// using it
jShoulda
.useStyle('my_custom_style');
== 1.2 2008-11-20
* By default, each root context creates a new Test.Unit.Runner instance, so if tests are loaded from multiple files (or the same file includes multiple root contexts), and logged to the same table, header will show incorrect data. (And worst, only one of the results would get logged by the rake task.)
Now, you can use `jShoulda.unifyRunners()` to get all your tests pushed to the same runner. In addition, if you have already written tests through the "traditional" syntax, you can pass your test runner, which will be reused.
* The configuration object can contain properties (other than setup/teardown/before/after) which are copied to each Test.Unit in the context—that is, are accesible through `this` inside your _should_ callbacks. Best understood through example:
context("A 'should' execution", {
assertLocalYipiyay : function(input, msg) {
this.assertEqual('yipiyay', input, msg);
}
},
should("get access to extra properties defined on the configuration parameter", function() {
this.assertLocalYipiyay('yipiyay');
})
)();
* The context aliaser is now a real generator and accepts a prefix as a second argument. So, for this testing code
jShoulda
.setContextAlias('un', 'Un')
.setContextAlias('para', 'para')
.setShouldAlias('deberia', 'debería');
un("programador",
para("ser feliz",
deberia("poder comer melocotones de Calanda todo el año", function() {
})
)
)();
the outputted name for our test will be "Un programador para ser feliz debería poder comer melocotones de Calanda todo el año".
* Contexts are now allowed to be anonymous.
== 1.1 2008-11-09
* jShoulda is now a global symbol
* Refactored code to allow simple aliasing
* Aliasing methods jShoulda.setShouldAlias and jShoulda.setContextAlias
* Configurable connector deprecated (and removed) in favor of jShoulda.setShouldAlias method.
* global methods `should` and `context` are now created through aliasing
* Try this, babe
jShoulda.setContextAlias('describe').setShouldAlias('it', '');
describe("A context", {},
it("runs tests", function() {
this.assert(true);
})
)();
* The configuration object (setup/teardown) is now optional
* before/after are documented alias to setup/teardown since this very moment.
== 1.0.1 2008-10-31
* Configurable connector. Overwrite `should.connector` if you want to use a localized connector.
== 1.0 2008-10-18
* Version set to 1.0, no code changes
== 0.0.3 2008-10-11
* Proven to work with the original Prototype unittest.js
== 0.0.2 2008-10-07
* Now the root context invocation returns a Test.Runner instance
== 0.0.1 2008-10-05
* 1 major enhancement:
* Initial release