Closed unkeep closed 6 months ago
Hey, you can achieve the same using Set
:
It("should doSmth1", func(){
depMock.Set(func(...) {
panic("is good for you")
})
Ω(func(){foo(depMock)}).Should(Panic())
})
I don't think it deserves a special helper.
It would be useful for testing expectations which do not return an error or the error does not interrupt a flow.
example code:
example test:
Of course the same could be done by adding panic() to the end of Inspect func, but the proposed way is more natural and shorter