Skip to content

Instantly share code, notes, and snippets.

@karlbohlmark
Created September 23, 2010 13:58
Show Gist options
  • Save karlbohlmark/593645 to your computer and use it in GitHub Desktop.
Save karlbohlmark/593645 to your computer and use it in GitHub Desktop.
var vows = require('vows'),
assert = require('assert'),
EventEmitter = require('events').EventEmitter,
myEventEmitter = new EventEmitter()
var A = function(){}
// Create a Test Suite
vows.describe('Testing and EventEmitter').addBatch({
'when the topic is a regular object':{
topic: new A(),
'the test gets executed' : function(topic){
assert.isNotNull(topic)
}
},
'when the topic is an EventEmitter': {
topic: myEventEmitter,
'The test is never executed': function (topic) { /*not fired!*/
assert.isNotNull(topic);
}
}
}).run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment