Open marmotz opened 11 years ago
@marmotz you are totally right!
What about somethign like that:
var o, myCallback;
this
.given(o = new MyObject())
.and(o.setSomething(myCallback = this.generateCallback()))
.if(o.doSomething())
.callback(myCallback) .wasCalled()
.resetCallback(myCallback)
//...
;
I'll also add the same method for mocks and stubs (resetMock
and resetStub
)
it seems great !
I can't write this code:
Because, in the second test, the callback was already called in first test.
So, we need a way to reset the callback controller.