/* This Vows test suite produces the following spec output with vows 0.5.1 and node 0.2.1. ♢ Emitter A NonEmitter does not inherit from EventEmitter ✓ and can be tested ✗ Errored » Emitter: An Emitter inherits from EventEmitter ∙ not fired! ✗ Errored » 1 honored ∙ 1 errored ∙ 1 dropped */ var assert = require('assert'), events = require('events'), vows = require('vows'); function Emitter () {} Emitter.prototype = new events.EventEmitter(); function NonEmitter () {} vows.describe('Inheriting from EventEmitter').addBatch({ 'An Emitter': { 'inherits from EventEmitter': { topic: function () { return new Emitter(); }, 'but cannot be tested': function (topic) { // this will never run assert.instanceOf(topic, Emitter); } } }, 'A NonEmitter': { 'does not inherit from EventEmitter': { topic: function () { return new NonEmitter(); }, 'and can be tested': function (topic) { assert.instanceOf(topic, NonEmitter); } } } }).export(module);