Version 1.1: optional configuration object, aliasing

1 view
Skip to first unread message

Choan Gálvez

unread,
Nov 9, 2008, 2:23:43 PM11/9/08
to jsho...@googlegroups.com
Hi all.

The brand new jShoulda 1.1 includes two new simple features:

1. The configuration (setup/teardown) object is now optional.
Previously we had to write

context("A context", {},
should("run tests", function() {
this.assert('Yay!');
})
)();

Now it's possible to skip the unneeded argument.

context("A context",
should("run tests", function() {
this.assert('Yay!');
})
)();

2. Aliasing. Remember my last mail? Then forget it, the
`should.connector` property has been removed. Now the library offers
two public methods, `jShoulda.setShouldAlias` and
`jShoulda.setContextAlias`, so you can write tests in any style you
feel comfortable with:

jShoulda
.setContextAlias('describe')
.setShouldAlias('it', '');

describe("A context",
it("runs tests", function() {
this.assert('Yay!');
})
)();

To learn more about aliasing, see <http://jshoulda.scriptia.net/tutorial/#aliasing
>.


Best.
--
Choan

Reply all
Reply to author
Forward
0 new messages