Skip navigation.

FlexMock and RubyCocoa

FlexMock and RubyCocoa

Because FlexMock and RubyCocoa disagree about the use of method_missing, you need to use flexmock as follows:flexmock(SomeSubclassOfNSObject)If the method you want to mock isn’t already defined on SomeSubclassOfNSObject, you have to define it before mocking it:class Watcher < OSX::NSObject def observeValueForKeyPath_ofObject_change_context( [...]