Kiwi Spec Unit Test: instance method '-attachToVerifier: verifier:' not found

I am building several QIWI tests and get a warning that I cannot explain. I am new to kiwi.

I have a layout setup:

id conversationMock = [KWMock mockForProtocol:@protocol(Conversation)]; [conversationMock stub:@selector(end)]; 

And in my controller, the property is called "conversation":

 @interface MyController () @property (nonatomic, assign) id<Conversation> conversation; @end 

The layout is assigned to the property, then in the specification I check if the "end" method is called in the conversation:

 it(@"should end conversation", ^{ [[[myController.conversation] should] receive] end]; [myController stopTalking]; }); 

The compiler (LLVM 3.0) shows a warning: "Instance method" -attachToVerifier: verifier: "not found"

What is the reason for this? Is this something I need to fix? (the test passes fine, verifies that the method call ends, works fine)

+8
objective-c unit-testing tdd cocoa-touch bdd
source share
3 answers

Specifying an identifier on NSObject resolves the warning:

[[(NSObject *) [myController.conversation] should] receive] end];

+12
source share

What you need to do:

 build settings -> Other Linker flags 

Add flag: -all_load

+9
source share

Based on @Komposr's answer, I looked at a couple of my projects with Kiwi and found that I needed to do the following:

Build Settings → Other Linker Flags

add flag: -ObjC

Note that I DO NOT USE CocoaPods. I downloaded and compiled Kiwi as a static library, which I include ...

+1
source share

All Articles