Skip to content

Instantly share code, notes, and snippets.

@luebken
Created January 12, 2011 22:00
Show Gist options
  • Save luebken/776991 to your computer and use it in GitHub Desktop.
Save luebken/776991 to your computer and use it in GitHub Desktop.
var assert = require('assert'),
EventEmitter = require('events').EventEmitter,
sys = require('sys'),
vows = require('vows');
var e = Object.create(EventEmitter.prototype);
vows.describe("Vows").addBatch({
"Creation": {
topic: e,
'should be': function (topic) {
sys.puts("e " + e);
}
}
})
.export(module);
@luebken
Copy link
Author

luebken commented Jan 12, 2011

Fails with
✗ Errored » Vows: Creation ∙ not fired!
✗ Errored » 1 errored ∙ 1 dropped

@luebken
Copy link
Author

luebken commented Jan 12, 2011

Note: This test is not complete. I just don't understand why it aborts. And where the error is.

@luebken
Copy link
Author

luebken commented Jan 12, 2011

So Vows has a special treatment of EventEmitters as topics. See "Promises" at http://vowsjs.org/#reference

So if I emit an event. Everything seems fine: https://gist.github.com/777075

Thanks to https://github.com/sanitz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment