You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When stubbing a class method that returns boolean on a class mock, an error occurs when trying to set the return value.
ExampleClass has a method with the following signature:
+ (BOOL)booleanClassMethod;
Here is the spec:
context(@"stubbing methods on class mocks", ^{
let(classMockForSubjectClass, ^Class{
return [KWMock mockForClass:[ExampleClass class]];
});
describe(@"stubbing a class method that returns boolean", ^{
it(@"should return YES when stubbed", ^{
[classMockForSubjectClass stub:@selector(booleanClassMethod) andReturn:theValue(YES)];
BOOL result = [classMockForSubjectClass booleanClassMethod];
[[theValue(result) should] beYes];
});
});
});
From the console:
Assertions: 'mocking a class method that returns boolean, should return YES when stubbed' [FAILED],
KWStubException "wrapped stub value type (B) could not be converted to the target type (@)" raised
Please let me know if I am not setting up this test properly or if you cannot reproduce. If someone can confirm this is a Kiwi bug and not operator error, I will spend some time trying to fix it.
The text was updated successfully, but these errors were encountered:
It seems not support for scale value, i find the source is implements with method signature invoke, but not find the implement of match method signature return value with obj like this @(YES).
When stubbing a class method that returns boolean on a class mock, an error occurs when trying to set the return value.
ExampleClass has a method with the following signature:
Here is the spec:
From the console:
Here is a simple iOS project that demonstrates this error:
https://github.com/jbelkins/KiwiBugExamples
Please let me know if I am not setting up this test properly or if you cannot reproduce. If someone can confirm this is a Kiwi bug and not operator error, I will spend some time trying to fix it.
The text was updated successfully, but these errors were encountered: