Skip to content
This repository has been archived by the owner on Nov 14, 2017. It is now read-only.

Commit

Permalink
write out new api style
Browse files Browse the repository at this point in the history
  • Loading branch information
garrensmith committed May 17, 2011
1 parent efb0485 commit d789526
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
46 changes: 46 additions & 0 deletions examples/new_sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
var describe = require('Jody').describe;

var value = "";

require.('Jody').beforeAll(function () {
value = "set in beforeAll"

});

describe('New Api').
it("Should have a global before all", function () {
value.should().beEqual("npmset in beforeAll");
}).
it("Should make async easy", function () {
var counter = 0;

setTimeout(function () {
counter++;

counter.should().beEqual(1);
async_complete();
}, 10);

async_wait();
}).
it("Should support multiple callbacks", function () {
var counter = 0;

setTimeout(function () {
counter++;

counter.should().beEqual(1);
async_complete();
},10);

setTimeout(function () {
counter++;

counter.should().beEqual(2);
async_complete();
},20);

async_wait(2);
});


11 changes: 10 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
var events = require('events'),
reporter = require('./reporter'),
configure = require('./Jody').configure,
specs = require('./Jody.js').specs;
specs = require('./Jody').specs;

var async_controller = {
waitForAsync: function(num) {

},
asyncComplete: function () {

}
};

var Runner = exports.Runner = function () {
events.EventEmitter.call(this);
Expand Down

0 comments on commit d789526

Please sign in to comment.