Closed andrey-sikerin closed 8 years ago
Thanks for the report, @andrey-sikerin! Hmm... that's a strange error message. I have a feeling it might have something to do with the private Apple NSObserver
class, and with Kiwi's very powerful mocking capabilities. We might be mocking something unexpected.
For now, if addListener:
works, I'd recommend just using that. 😅
Sorry for the trouble!
Hi everyone,
I use Observer pattern and want to test it. Please look some piece of code:
And I have following test:
My tests fails due to
- NSInvalidArgumentException "Attempt to add non-NSObserver object <> as an observer of <KWMock>"
raised.It happens when
[observable addObserver:]
was called inside Object class.If following line
is commented, code doesn't raise NSInvalidArgumentException.
If
addObserver:
is changed on some other name (addListener:
for example) everything is good.What is wrong with my code?