Closed bDev10 closed 2 weeks ago
Hi! Could you provide me a reproducer? I'm not able to reproduce it based on your samples.
Hi, I'm sorry it was my fault, so false alarm. Not spot that the class with injected mock called the yet unmocked function in init block, so just mock was called earlier then I expected when I wrote the test and the error was legit!
Seems like mocking outside of
mock()
function'sblock
parameter is not working, although documentation suggests it should work. E.g. for:We get error:
When
every
is called from theblock
parameter, mocking works:Checked on version
2.5.0
.Would be useful to have this feature working e.g. for cases where mocked instance is created outside of test function and we want specify mocking behavior expected for specific test case.