1

I'm not sure if I'm doing it right but I'm trying to stub an NSNumber property on a core data object.

Here's my test example:

   it(@"should say 1 / ? with 1 point", ^{
            mockCard = [KWMock nullMockForClass:[Card class]];
            [mockCard stub:@selector(points) andReturn:[NSNumber numberWithInt:1]];
            controller.card = mockCard;
            [[controller.lblCount.text should] equal:@"1 / ?"];     
   });

And my source code:

 -(void)setCard:(Card *)aCard{
     if ([card.points intValue] == 1) {
          lblCount.text = @"1 / ?";
     }
 }

Running this causes a SIGKIL error in the writeObjectValueToInvocationReturnValue method.

Am I missing something?

Update

attempted to change the stub to:

[mockCard stub:@selector(points) andReturn:theValue(1)]
...

 [FAILED], wrapped stub value type (i) could not be converted to the target type (v)
4

1 回答 1

-1

这是 Kiwi 中的错误,在此处进行了描述:https ://github.com/allending/Kiwi/issues/63

于 2011-10-28T17:33:23.093 回答