cloudhead/vows — Issue #173: Testing for errors
Author: Phoscur
Created: 2011-12-27 20:03:57+00:00
State: open

Related: https://github.com/cloudhead/vows/issues/132

I'm trying to test for a failure when two objects interact, a's method interact() throws an error. I'm not sure how to really do this, I can't get parent topics in the vow, so I can't trigger the error in the vow without writing a helper topic putting current and parent topic together in an object, which is clumsy.

Maybe my problem is that I dont know how I have to write failing tests in vows, or I don't get the vow/topic separation. I ran into enough problems with vows for now, I'll try another testing framework.

```javascript
'A': {
topic: new A,
'and B': {
topic: new B,
'interact': {
topic: function(a, b) {
return a.interact(b) // throws an error
},
'should fail': function(topic) {
assert.fail(topic)
}
},
'interact fails': function(a, b) {
console.dir(arguments) // [null (??!), B]
}
....
```