cloudhead/vows — pull request #145 by seebees (2011-10-22 22:02:24+00:00)
Title: Vows for events other then 'Success'

This is a pull for #109.

I needed to resolve the issue between dealing with topics that are explicitly EventEmitters and topics that inherit from EventEmitters.

The syntax I'm using is like this:

```javascript
"A topic that emits many events" : {
topic: function () {
return new CrazyEmitter();
},
"[request]" : {
"will emit the new request" : function () {},
"will set my class with a cached element" : function () {},
"[end]" : {
"will be clean" : function(){}
}
}
}
```

`[request]` and `[end]` I term sub-events. The `[end]` vows will be tested after the `[request]` vows. But I do not have anything to guarantee the event order. Which would be nice. Ideas?

If a Context is a sub-event

* it will have a property `this.isEvent === true`.
* it must not have a topic in it's definition.
* it's parent topic must inherit from EventEmitter.

If the above is not true it will throw. I can change that, now that I'm thinking about it I may need to so that the vows can be stubbed out.

In any event I need explicit tests for all this as well so don't merge it right now. But please do comment on direction and syntax.

Also note, this will resolve #76.