Open jonasfa opened 10 years ago
No comments? I could work on it if you agreed with such change... I just don't want to work on something that may be rejected later.
I would also like to see this added
Definitely required. Not sure why nobody has looked at this issue for so long? Even partial mocks return nil for valueForKey
though actual object returned correct value. In KWMock, we need to stub valueForKey
and valueForKeyPath
explicitly if mock is expected to respond to those. But that should be default behaviour as in normal objects.
Should work, but doesn't:
Stubbing
valueForKey:
would be painful for a complex KeyPath. Eg, with a collection:[arrayOfMocks valueForKeyPath:@"@unionOfObjects.something"]
There is official documentation on the default implementation of
valueForKey:
: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/SearchImplementation.html#//apple_ref/doc/uid/20000955-138234-BAJCAJGJ